Skip to main content

Docker Interface Build Status Development Status

Docker Interface (DI) is a declarative interface for building images and running commands in containers using Docker. At Spotify, we use Docker Interface to minimise environment drift by running all of our code in containers–during development, production, or to train machine learning models.

Installing Docker Interface

You can install Docker Interface using the following pip command (you need a python3 interpreter).

pip install docker-interface

To check that Docker Interface was installed successfully, run

di --help

Using Docker Interface

Docker Interface can be invoked from the command line. By default, it reads the configuration from the file di.yml in the current working directory, a basic version of which is shown below.

build:
  tag: name-of-your-image

Docker interface supports two commands:

  • build builds and tags Docker image using the current working directory as the build context.
  • run runs a Docker command in a container and mounts the current working directory with appropriate permissions at /workspace so you can access your local files without having to rebuild the image.

You can find more extensive examples in the examples folder in this repository. You can find more detailed information here. Check the schema to get a comprehensive overview of the declarative syntax supported by Docker Interface.

Contributing to Docker Interface

To contribute to the development of Docker Interface, please create a fork of the repository and send any changes as a pull request.

You can test your local installation of Docker Interface as follows.

# 0. Set up a virtual environment (optional but recommended)
# 1. Install development requirements
pip install -r requirements.txt
# 2. Run the tests
make tests

See virtualenv or conda for details on how to set up a virtual environment in step 0.

Code of conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honour this code.

Metadata

Release files for docker-interface 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docker-interface 0.4.3
File Size Uploaded
docker_interface-0.4.3.tar.gz 15.9 kB Details

Release files / docker_interface-0.4.3.tar.gz

Download URL docker_interface-0.4.3.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
84db2a151b76f7526a8e6a499f6e66f36ceb62a7d44323482b96d59e6a0e933b
BLAKE2b-256 checksum
How to use checksums
70ee33189ac031ef7b4d4a9eecf5a2ecd50d686ac56fc34f1695ef43791a25e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.4.3 This release

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.13

1 release file

0.2.12

1 release file

0.2.11

1 release file

0.2.10

1 release file

0.2.9

1 release file

0.2.8

1 release file

0.2.7

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page