Docker images and registries¶
Building¶
Podman/Buildah¶
Build for a different/multiple architectures¶
- Arch wiki: Podman/Foreign architectures
- Building Multi-Architecture Containers with Buildah
- Podman blog: Working with container image manifest lists
Install qemu dependencies:
Then build for i.e. linux/arm64/v8 and linux/amd64 archtecture:
or with buildah:
Validate local manifest:
Then push:
Use skopeo to validate the remote manifest:
export REMOTE_TAG=registry.gitlab.com/.../multiarch:latest
skopeo inspect --raw docker://$REMOTE_TAG | jq '.manifests[].platform'
Use podman to validate the remote manifest:
Docker¶
from Dockerfile
where varac/squid_deb_proxy is the name of the image that gets created
Cross-compiling / builds¶
Registry¶
List tags using podman:
List tags using curl/docker.io API:
curl -s https://registry.hub.docker.com/v2/repositories/leapcode/jessie/tags/ \
| jq '."results"[]["name"]'
image_name=python
curl -s https://registry.hub.docker.com/v1/repositories/${image_name}/tags \
| jq ".[].name" | sed -e "s/\"//g"
Push images to registry¶
Use a personal access token to login (for Gitlab: read_registry, write_registry scope)
docker login registry.0xacab.org
docker push registry.0xacab.org/infrared/platform_wg/docker-tmate-server/docker-tmate-server:latest
Private registries¶
All of these authentication methods require the minimum scope: For read (pull) access, to be read_registry. For write (push) access, to bewrite_registry and read_registry.
Also, the developer role must be granted for pull access
Analyse image¶
podman inspect docker.io/debian:stable | ijq
podman inspect docker.io/debian:stable | grep Architecture
podman inspect docker.io/debian:stable | jq -r '.[].Config.Cmd'
dive¶
https://github.com/wagoodman/dive
Install:
Use with Podman:
Show dockerfile / build history from image¶
https://github.com/lukapeschke/dockerfile-from-image
Useful when there's no published Dockerfile.
Image update monitoring tools¶
Diun¶
Unlike WatchTower, Diun does not update containers but only handles notification via webhook or email.
- Small footprint
- No prometheus metrics
Watchtower¶
Deprecated¶
- https://github.com/pyouroboros/ouroboros
- Prom support