Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Latest commit

 

History

History
186 lines (121 loc) · 4.49 KB

PITCHME.md

File metadata and controls

186 lines (121 loc) · 4.49 KB

@title[Introduction]

Offline Docker

How to use docker for (almost) continuous delivery to an offline environment.*



[ Docker, Compose, Linux, Windows ]

Initial Situation

  • Apps built with Docker |
  • Orchestrated with docker-compose |

Production Environment

  • disconnected, |
  • remote or |
  • just inaccessible. |
  • How to deploy? |

Docker Workflow

  • Similar to Git:
    • Git: Workflow for code |
    • Docker: Workflow for runtime images |

Changes, Revisions


Tagging


Publish


Consume


Transfer Medium (online)


Transfer Medium (offline)


Demo

+++

@title[Step 1. Build & Push]

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

See docker images

+++

Pull Through Cache


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]

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!]

STEP 3. Ship It!*


Cat customer waiting...

*Not our business here.

+++ @title[Step 4. Import & Run]

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)


Ok, got it! How to apply to my project?

+++?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! |

View The Code