feat(compose): Work with a registry
This commit is contained in:
@@ -32,15 +32,28 @@ docker context create fully.qualified.domain.name --docker 'host=ssh://root@full
|
||||
|
||||
## Build
|
||||
|
||||
> Skip to [Pull](#pull) if you already have images in your private registry ready to use. Otherwise read on to build them now.
|
||||
|
||||
FIXME We build the `vault` image locally. Our adjustment to the official image is simply adding `/tmp/vault` to it. See [build-context/Dockerfile](build-context/Dockerfile). We use `/tmp/vault` to bind-mount a dedicated ZFS dataset for the application's `tmpdir` location.
|
||||
|
||||
```
|
||||
docker compose --project-name "${COMPOSE_PROJECT}" --file "${COMPOSE_FILE}" --file "${COMPOSE_OVERRIDE}" --env-file "${COMPOSE_ENV}" --profile 'build-vault' build
|
||||
```
|
||||
|
||||
## Push
|
||||
|
||||
Push to Docker Hub or your private registry. Setting up a private registry is out of scope of this repo.
|
||||
|
||||
```
|
||||
source "${COMPOSE_ENV}"
|
||||
docker push "registry.example.com/project/vault:${VAULT_BUILD_DATE}-${VAULT_VERSION}"
|
||||
```
|
||||
|
||||
## Pull
|
||||
|
||||
FIXME Rewrite either [Build](#build) or this paragraph for which images are built and which ones pulled, `--profile 'full'` may not make sense FIXME Pull images from Docker Hub verbatim.
|
||||
> Skip this step if you just built images that still exist locally on your build host.
|
||||
|
||||
FIXME Rewrite either [Build](#build) or this paragraph for which images are built and which ones pulled, `--profile 'full'` may not make sense.
|
||||
|
||||
```
|
||||
docker compose --project-name "${COMPOSE_PROJECT}" --file "${COMPOSE_FILE}" --env-file "${COMPOSE_ENV}" --profile 'full' pull
|
||||
@@ -48,7 +61,7 @@ docker compose --project-name "${COMPOSE_PROJECT}" --file "${COMPOSE_FILE}" --en
|
||||
|
||||
## Copy to target
|
||||
|
||||
Copy images to target Docker host, that is assuming you deploy to a machine that itself has no network route to reach Docker Hub. Copying in its simplest form involves a local `docker save` and a remote `docker load`. Consider the helper mini-project [quico.space/Quico/copy-docker](https://quico.space/Quico/copy-docker) where [copy-docker.sh](https://quico.space/Quico/copy-docker/src/branch/main/copy-docker.sh) allows the following workflow:
|
||||
Copy images to target Docker host, that is assuming you deploy to a machine that itself has no network route to reach Docker Hub or your private registry of choice. Copying in its simplest form involves a local `docker save` and a remote `docker load`. Consider the helper mini-project [quico.space/Quico/copy-docker](https://quico.space/Quico/copy-docker) where [copy-docker.sh](https://quico.space/Quico/copy-docker/src/branch/main/copy-docker.sh) allows the following workflow:
|
||||
|
||||
```
|
||||
source "${COMPOSE_ENV}"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
services:
|
||||
vault-build:
|
||||
image: "vault:${VAULT_VERSION}"
|
||||
# FIXME image name with or without slash? Docker Hub or private registry? With or without *_BUILD_DATE? FIXME
|
||||
image: "registry.example.com/project/vault:${VAULT_BUILD_DATE}-${VAULT_VERSION}"
|
||||
profiles: ["build"]
|
||||
build:
|
||||
context: "build-context/vault"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
services:
|
||||
vault:
|
||||
# FIXME Docker Hub image name with or without slash? FIXME
|
||||
image: "vault:${VAULT_VERSION}"
|
||||
# FIXME image name with or without slash? Docker Hub or private registry? With or without *_BUILD_DATE? FIXME
|
||||
image: "registry.example.com/project/vault:${VAULT_BUILD_DATE}-${VAULT_VERSION}"
|
||||
container_name: "vault-${CONTEXT}"
|
||||
networks:
|
||||
vault-default:
|
||||
|
@@ -6,6 +6,7 @@ CONTEXT=ux_vilnius
|
||||
# ---
|
||||
# VAULT_VERSION=x.y.z
|
||||
# VAULT_VIP=10.1.1.2
|
||||
# VAULT_BUILD_DATE=20230731
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user