https://github.com/olegstepura/docker-shell
🐳 A set of usefull functions for writing interactive docker scripts
https://github.com/olegstepura/docker-shell
bash docker
Last synced: about 2 months ago
JSON representation
🐳 A set of usefull functions for writing interactive docker scripts
- Host: GitHub
- URL: https://github.com/olegstepura/docker-shell
- Owner: olegstepura
- License: mit
- Created: 2015-12-15T11:52:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-10T20:45:05.000Z (about 10 years ago)
- Last Synced: 2025-03-30T11:41:34.250Z (about 1 year ago)
- Topics: bash, docker
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-shell
A set of usefull functions for writing interactive [docker](https://www.docker.com/) `build` and `run` scripts.
Dependencies are: [`rlwrap`](http://utopia.knoware.nl/~hlub/uck/rlwrap/#rlwrap) (available in debian), `bash`, `sudo`, `curl`, and `docker` (surprise! :)
Functions take named parameters via environment variables e.g. `FOO="test" my_func`,
most require a special variable named `VAR` which contains name of environment
variable that will contain function result:
```bash
VAR=TEST my_foo
# Now $TEST contains result of running my_foo (most likely some string)
echo $TEST # outputs result of running my_foo
```
`shared-functions.sh` is not that long, go ahead and read it. Each function contains
a comment with possible argument variables. Some of them are bypassed as is to an
inner function invocation so it's not that obvious.
Note, that after running set of commands with the right name passed to `VAR` there is
no need to pass that vars to later commands explicitly:
```bash
VAR=TEST1 my_foo
VAR=TEST2 my_bar
# $TEST1 and $TEST2 are available here
# no need to run
TEST1="$TEST1" TEST2="$TEST2" foo_bar
# just call
foo_bar
```