项目作者: tadeugr

项目描述 :
Build Docker images with custom packages for local development, testing and daily tasks.
高级语言: Python
项目地址: git://github.com/tadeugr/dugaire.git
创建时间: 2020-11-16T22:10:58Z
项目社区:https://github.com/tadeugr/dugaire

开源协议:Apache License 2.0

下载


Quickly build custom Docker images for local development without having to write Dockerfiles.

PyPI
Python
Code style: black
test
publish
codecov
Documentation Status
FOSSA Status

Examples

  1. # Build an image with vim and curl using apt-get
  2. docker run -it --rm $(dugaire build --apt=vim,curl)
  3. # Build an image with wget, and nano using apt-get and install latest azure-cli version using pip3.
  4. docker run -it --rm $(dugaire build --apt=wget,nano --pip3=azure-cli)
  5. # Build an image with latest kubectl version
  6. docker run -it --rm $(dugaire build --with-kubectl=latest)
  7. # Build an image with kubectl 1.15.0
  8. docker run -it --rm $(dugaire build --with-kubectl=1.15.0)

Install (on Linux)

  1. pip install dugaire

From source

Clone this repository.

  1. git clone https://github.com/tadeugr/dugaire.git

cd to its directory.

  1. cd dugaire

Install it (requires pip).

  1. make install

You should have the command available.

  1. dugaire build --help

Usage

  1. Usage: dugaire [OPTIONS] COMMAND [ARGS]...
  2. CLI tool to build and manage custom Docker images.
  3. Options:
  4. --version Show the version and exit.
  5. --help Show this message and exit.
  6. Commands:
  7. build Build Docker images with custom packages.
  8. list List images built with dugaire.
  9. rmi Remove images built with dugaire.
  10. version Show the version and exit.

dugaire build

  1. Usage: dugaire build [OPTIONS]
  2. Build Docker images with custom packages.
  3. Examples:
  4. Build an image and install vim and curl using apt-get.
  5. $ dugaire build --apt=vim,curl
  6. Build an image and install python3 using apt-get and ansible using pip3.
  7. $ dugaire build --apt=python3-pip --pip3=ansible
  8. Build an image and install the latest version of kubectl.
  9. $ dugaire build --with-kubectl=latest
  10. Options:
  11. --from <name:tag> Base image (used in Dockerfile FROM).
  12. Example: --from=ubuntu:20.04 [default:
  13. ubuntu:20.04; required]
  14. --name <name:tag> Image name. Example: --name="myimage:0.0.1"
  15. [default: random]
  16. --apt <pkg01|pkg01,pkg02> Comma separeted list of packages (no blank
  17. space) to install using apt-get install.
  18. Requires a base image with apt-get. Example:
  19. -apt=curl,vim
  20. --pip3 <pkg01|pkg01,pkg02> Comma separeted list of packages (no blank
  21. space) to install using pip3 install.
  22. WARNING: requires -apt=python3-pip. Example:
  23. -apt=python3-pip -pip3=ansible,jinja2
  24. --with-kubectl <latest|semantic versioning>
  25. Install kubectl. Examples: --with-
  26. kubectl=latest / --with-kubectl=1.17.0
  27. --with-terraform <latest|semantic versioning>
  28. Install terrafom. Examples: --with-
  29. terraform=latest / --with-terraform=0.15.5
  30. --with-velero <latest|semantic versioning>
  31. Install velero. Examples: --with-
  32. velero=latest / --with-velero=1.5.2
  33. --force Ignore Docker cache and build from scratch.
  34. --dry-run Do not build image.
  35. -o, --output [image.id|image.id.short|image.name|dockerfile]
  36. Command output options. [default:
  37. image.id.short]
  38. --help Show this message and exit.

Enable autocomplete

To enable autocomplete for your current terminal session, run:

  1. eval "$(_DUGAIRE_COMPLETE=source dugaire)"

Follow the instructions bellow to permanently enable autocomplete.

bash

  1. echo 'eval "$(_DUGAIRE_COMPLETE=source dugaire)"' >> ~/.bashrc

zsh

  1. echo 'eval "$(_DUGAIRE_COMPLETE=source dugaire)"' >> ~/.zshrc

Supported features

Base images

Tested with:

  • ubuntu:20.04

You may use base images that were built from the tested images.

Package/Dependency managers

apt-get

You can install any package using apt

Use a comma separated list (no blank space) of packages you want to install.

Example:

  1. dugaire build --apt=wget,iputils-ping

pip3

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:

  1. dugaire build --pip3=jinja2,azure-cli==2.39.0

Applications

kubectl

Options

--with-kubectl=latest to install the latest version.

--with-kubectl=1.17.0 (example) to install specific versions.

See all versions available here.

Covered by automated tests

You may install any version available. The commands bellow only describes versions included in the automated tests.

  1. dugaire build --from=ubuntu:20.04 --with-kubectl=latest
  2. dugaire build --from=ubuntu:20.04 --with-kubectl=1.18.0
  3. dugaire build --from=ubuntu:20.04 --with-kubectl=1.17.0
  4. dugaire build --from=ubuntu:18.04 --with-kubectl=1.16.0
  5. dugaire build --from=ubuntu:18.04 --with-kubectl=1.15.0

terraform

Options

--with-terraform=latest to install the latest version.

--with-terraform=0.15.05 (example) to install specific versions.

See all versions available here.

Covered by automated tests

You may install any version available. The commands bellow only describes versions included in the automated tests.

  1. dugaire build --from=ubuntu:20.04 --with-terraform=latest
  2. dugaire build --from=ubuntu:20.04 --with-terraform=0.15.05

velero

Options

--with-velero=latest to install the latest version.

--with-velero=1.5.2 (example) to install specific versions.

See all versions available here.

Covered by automated tests

You may install any version available. The commands bellow only describes versions included in the automated tests.

  1. dugaire build --from=ubuntu:20.04 --with-kubectl=latest --with-velero=latest
  2. dugaire build --from=ubuntu:20.04 --with-kubectl=1.17.0 --with-velero=1.5.2

License

Product license

Apache License Version 2.0, January 2004. Read more.

FOSSA scan overview

FOSSA Status

FOSSA Live Project report

The report is available here