Quickly build custom Docker images for local development without having to write Dockerfiles.
# Build an image with vim and curl using apt-get
docker run -it --rm $(dugaire build --apt=vim,curl)
# Build an image with wget, and nano using apt-get and install latest azure-cli version using pip3.
docker run -it --rm $(dugaire build --apt=wget,nano --pip3=azure-cli)
# Build an image with latest kubectl version
docker run -it --rm $(dugaire build --with-kubectl=latest)
# Build an image with kubectl 1.15.0
docker run -it --rm $(dugaire build --with-kubectl=1.15.0)
pip install dugaire
Clone this repository.
git clone https://github.com/tadeugr/dugaire.git
cd
to its directory.
cd dugaire
Install it (requires pip
).
make install
You should have the command available.
dugaire build --help
Usage: dugaire [OPTIONS] COMMAND [ARGS]...
CLI tool to build and manage custom Docker images.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
build Build Docker images with custom packages.
list List images built with dugaire.
rmi Remove images built with dugaire.
version Show the version and exit.
Usage: dugaire build [OPTIONS]
Build Docker images with custom packages.
Examples:
Build an image and install vim and curl using apt-get.
$ dugaire build --apt=vim,curl
Build an image and install python3 using apt-get and ansible using pip3.
$ dugaire build --apt=python3-pip --pip3=ansible
Build an image and install the latest version of kubectl.
$ dugaire build --with-kubectl=latest
Options:
--from <name:tag> Base image (used in Dockerfile FROM).
Example: --from=ubuntu:20.04 [default:
ubuntu:20.04; required]
--name <name:tag> Image name. Example: --name="myimage:0.0.1"
[default: random]
--apt <pkg01|pkg01,pkg02> Comma separeted list of packages (no blank
space) to install using apt-get install.
Requires a base image with apt-get. Example:
-apt=curl,vim
--pip3 <pkg01|pkg01,pkg02> Comma separeted list of packages (no blank
space) to install using pip3 install.
WARNING: requires -apt=python3-pip. Example:
-apt=python3-pip -pip3=ansible,jinja2
--with-kubectl <latest|semantic versioning>
Install kubectl. Examples: --with-
kubectl=latest / --with-kubectl=1.17.0
--with-terraform <latest|semantic versioning>
Install terrafom. Examples: --with-
terraform=latest / --with-terraform=0.15.5
--with-velero <latest|semantic versioning>
Install velero. Examples: --with-
velero=latest / --with-velero=1.5.2
--force Ignore Docker cache and build from scratch.
--dry-run Do not build image.
-o, --output [image.id|image.id.short|image.name|dockerfile]
Command output options. [default:
image.id.short]
--help Show this message and exit.
To enable autocomplete for your current terminal session, run:
eval "$(_DUGAIRE_COMPLETE=source dugaire)"
Follow the instructions bellow to permanently enable autocomplete.
echo 'eval "$(_DUGAIRE_COMPLETE=source dugaire)"' >> ~/.bashrc
echo 'eval "$(_DUGAIRE_COMPLETE=source dugaire)"' >> ~/.zshrc
Tested with:
ubuntu:20.04
You may use base images that were built from the tested images.
You can install any package using apt
Use a comma separated list (no blank space) of packages you want to install.
Example:
dugaire build --apt=wget,iputils-ping
You can install any package using pip3
Use a comma separated list (no blank space) of packages you want to install.
Use <package name>==<version>
to install specific versions.
Example:
dugaire build --pip3=jinja2,azure-cli==2.39.0
--with-kubectl=latest
to install the latest version.
--with-kubectl=1.17.0
(example) to install specific versions.
See all versions available here.
You may install any version available. The commands bellow only describes versions included in the automated tests.
dugaire build --from=ubuntu:20.04 --with-kubectl=latest
dugaire build --from=ubuntu:20.04 --with-kubectl=1.18.0
dugaire build --from=ubuntu:20.04 --with-kubectl=1.17.0
dugaire build --from=ubuntu:18.04 --with-kubectl=1.16.0
dugaire build --from=ubuntu:18.04 --with-kubectl=1.15.0
--with-terraform=latest
to install the latest version.
--with-terraform=0.15.05
(example) to install specific versions.
See all versions available here.
You may install any version available. The commands bellow only describes versions included in the automated tests.
dugaire build --from=ubuntu:20.04 --with-terraform=latest
dugaire build --from=ubuntu:20.04 --with-terraform=0.15.05
--with-velero=latest
to install the latest version.
--with-velero=1.5.2
(example) to install specific versions.
See all versions available here.
You may install any version available. The commands bellow only describes versions included in the automated tests.
dugaire build --from=ubuntu:20.04 --with-kubectl=latest --with-velero=latest
dugaire build --from=ubuntu:20.04 --with-kubectl=1.17.0 --with-velero=1.5.2
Apache License Version 2.0, January 2004. Read more.
The report is available here