Prepares a docker project in the current directory, setting up a structure that makes it easier to build/rebuild/debug and run developing projects.
dockerprep SOURCE_IMAGE[:TAG] REPO TAG NAME
Linux:
alias dockerprep='docker run --rm -it --user="$(id -u):$(id -g)" --volume="$(pwd -P):/project" electricwarr/dockerprep:0.9'
NB: --user is needed here to avoid writing all files as root
MacOS:
alias dockerprep='docker run --rm -it --volume="$(pwd -P):/project" electricwarr/dockerprep:0.9'
The electricwarr/dockerprep image will be downloaded on the first invocation.
You can find the latest version on Docker Hub:
https://hub.docker.com/u/electricwarr/
When run in an empty directory, dockerprep will create a new docker project based on input parameters. These parameters will be saved to a config file, project.cfg, as well as preserved to a hidden file .dockerprep.cfg.
dockerprep checks for .dockerprep.cfg to prevent losing data if run in a non-empty directory.
x.y, where x is incremented for breaking changes (after 1.0) and y other changes.
- Give the option to abort before overwriting any files
dockerprepcurrently will refuse to run on finding.dockerprep.cfg- If run in an existing project without
.dockerprep.cfg, existing files (eg. Dockerfile) can be overwritten without warning
- Run
git init,git add .andgit commit -m 'initial commit (dockerprep)'IFFgitis installed and the current directory is not part of a git repository.
- Should this be in Go? Python? Node.js?
Thinking of rewriting in another language (probably Go) to be less dependent on shell environment.