docked

A human-friendly alternative to Dockerfile. It’s a Python library for generating Docker images, with API designed to be safe, secure, and easy-to-use correctly.

Features:

  • Just a Python library. No custom syntax, no monkey-patching, no magic. Get the full power of Python.

  • 100% type-safe. The code base is fully type annotated and type checked, and we put a lot of effort to make the best API that makes invalid or insecure usage impossible.

  • Supports all versions of Dockerfile and Containerfile standards and syntax.

  • Automatically picks the most compatible syntax version based on the features you use.

  • Built-in linter to help you to make safe and effective containers.

  • API is very close to that of Dockerfile.

  • Our top priority is to provide a friendly and simple way of making Docker images. We carefully designed our API to avoid the most common mistakes of Docker newcomers.

  • Generates a human-readable and valid Dockerfile, so you can use it together with any other tools without any vendor-lock.

Why

The Dockerfile already exists, and yet we made this project. There are many good reasons for that:

  • Python is powerful. You get loops, conditions, environment variables, command-line tools, and a lot of other cool stuff that Dockerfile will never get.

  • Python has a great tooling. You get linters, type-checker, autoformatters, debugger, autoomplete, syntax highlighting, and so on to make your code easy to write, read, and maintain.

  • Python has a great ecosystem. You can use docker.py to go beyond of just building containers, boto3 to access S3 secrets at build-time, slack SDK to send notifications about build status, toml to read config files, dotenv to support .env files, and anything else you can ever imagine.

  • Python has a consistent and expressive syntax designed by smart people over many years.

Our goal was to provide the best possible IDE assistance to the users. All API is concise, precise, explicit, well-documented, and 100% type anntated. Docked will give your team greater learning experience than Docker can ever dream of.

Installation

python3 -m pip install docked

Docs