Dockerize a Pipeline
Docker files are amazing, and you shouldn't write them.
This section will teach you:
How to build Docker containers for your pipeline
How to specify Python package dependencies (just use setup.py!)
How to send the container to AWS ECR (if you've set up your AWS credentials)
The Disdat dockerizer will build a container based on your project's setup.py
It will install any Python dependencies it finds in that setup.py
file. If you're project can create a source distribution via pip setup.py sdist
then you can use Disdat to dockerize your pipeline.
Pro Tip: Does your project depend on packages in your organization's own PyPi server? If so, you'll want to create a pip.conf
file and then refer to it in the Disdat configuration file like this.
Build the container
Have you installed Docker on your dev box? Do that first!
Change into your project's directory.
Run
dsdt dockerize <your project's directory>
Disdat builds one container per git repository. Thus one container can be used to run all the pipelines you define in that repository.
Check to see if your container is now registered with Docker
Note: Disdat names of your container based on the name
field in your setup.py file.
Pro Tip: By default we build containers with based on Python 3.6.8-slim. If you're in desperate need of Python 2.7, something has gone wrong with your dev process. If you're in desperate need for Python 3.6.8 +, then you'll need to make a PR to the project for another version of slim that looks like this file.
Last updated
Was this helpful?