@title[Introduction]
[ Docker, Compose, Linux, Windows ]
- Apps built with Docker |
- Orchestrated with docker-compose |
- disconnected, |
- remote or |
- just inaccessible. |
- How to deploy? |
- Similar to Git:
- Git: Workflow for code |
- Docker: Workflow for runtime images |
- git tag |
- docker tag |
- git push |
- docker push |
- git pull |
- docker pull |
+++
@title[Step 1. Build & Push]
$ docker-compose up -d registry ui
$ docker-compose build
$ docker-compose push
@[1](Start local Docker registry (on :5000
, Web UI at :8080))
@[2](Build all apps (...tag to localhost:5000
))
@[3](Push built images to registry)
+++
Registry frontend on :8080
+++
You can also access local images, e.g. from your company registry.
Add the registry acting as pull through cache to docker-compose
:
environment:
...
REGISTRY_PROXY_REMOTEURL: https://<your-awesome-registry>
Afterwards just pull your local images:
docker pull localhost:5000/<repo>/<image>:<tag>
+++ @title[Step 2. Export]
docker-compose run export
docker save -o ./data/registry.tar registry:2.6.2 konradkleine/docker-registry-frontend:v2
@[1](Export volume docker_images -> ./data/docker_images.bz2
.)
@[2](Save registry
images (you're offline, remember?))
+++ @title[Step 3. Ship It!]
*Not our business here.
+++ @title[Step 4. Import & Run]
docker load -i ./data/registry.tar
docker-compose run import
docker-compose up -d registry ui
docker run [registry:5000]/mycompany/myapp:latest
@[1](Load registry
images (you're offline, rembember?))
@[2](Import volume ./data/docker_images.bz2 -> docker_images
)
@[3](Start your registry)
@[4](Run images, pulling from your registry)
+++?code=docker-compose.yml&lang=yml
In your docker-compose.yml
:
@[5](Tag images to local registry localhost:5000
)
+++?code=docker-compose.override.yml&lang=yml
Add this docker-compose.override.yml for:
@[11-13](Docker registry) @[24-25](Web UI for registry) @[43-45,47-49](Export & Import) @[51-52](Docker volume for registry images)
- That's it! |