Docker mirroring for networks without internet connectivity
python3 -m dockermirror --help
Create archive:
curl -v -H 'Content-Type: application/json' -XPOST -d '{"images": ["debian:latest", "python:3"]}' http://dockermirror:5000/api/v1/archive
Check url from location header for status:
curl -v http://localhost:5000/api/v1/job/69e0eb21-7847-481a-96e6-2af2f773efa7
When the job has finished it is possible to check archive information from the status url location header as long as the file still exists:
curl -v http://dockermirror:5000/api/v1/archive/_sYP7FfCCETSPeaNkQFXH69DLAPORf7ly2EhpGSQ1Ak.tar
In non-dev environments the docker-compose files are configured to use a named docker volume called archives handled externally. That means that this volume should be preinitialized before starting the containers.
# Example bind mounted named volume
docker volume create --opt type=none --opt o=bind --opt device=/path/to/archives --name archives
docker-compose run --rm dockermirror <dockermirror_args>
docker-compose -f api-docker-compose.yml up -d
docker-compose -f test-docker-compose.yml run --rm dockermirror-test