Docker Multi-Arch Images#
The cours-devops-docker course uses Docker images in lab exercises that must run on both amd64 (standard x86-64 PCs) and arm64 (Apple M-series, Raspberry Pi, Radxa Zero) machines. This creates a practical constraint: not all images referenced in the course support multiple architectures, and the workaround for university network access (a Squid proxy) compounds this because the most commonly cited proxy image (sameersbn/squid) is amd64-only.
Architecture Context#
Docker images encode their target architecture in their metadata. You can inspect it with:
docker image inspect <image> --format '{{.Architecture}}'
The course illustrates this in a debugging exercise where docker image inspect bad-nginx:1 reveals "Architecture": "amd64" — and the instructor notes this image won't run on Apple M1 machines .
Docker's buildx plugin enables building images for architectures beyond the host's native platform (including RISC-V). The course introduction references this capability in the context of running Docker on ARM devices such as Raspberry Pi and Radxa Zero .
Proxy Image: Multi-Arch Availability#
Course labs run behind a university network that rate-limits Docker Hub pulls by shared IP . A Squid proxy is used to work around this. Two proxy images are referenced:
| Image | Multi-Arch Support |
|---|---|
sameersbn/squid | amd64 only — all tags (latest, 3.5.27-2, 3.3.8-*) are linux/amd64 exclusively |
ubuntu/squid | Multi-arch — supports amd64, arm64, ppc64le, s390x on maintained tags |
Implication: The sameersbn/squid:3.5.27-2 command shown in course notes will fail silently or error on arm64 hosts. Use ubuntu/squid instead when running on ARM hardware.
Proxy Setup in Lab Exercises#
The CMD vs ENTRYPOINT exercise uses Squid as a supporting proxy container. The minimal squid.conf used is the same in both the lecture notes and the code samples :
http_port 3128
acl all src all
http_access allow all
To launch the proxy with the multi-arch-compatible image:
docker run --name squid -d --restart=always --publish 3128:3128 \
-v $(pwd)/squid.conf:/etc/squid/squid.conf ubuntu/squid
The course notes show the equivalent using sameersbn/squid:3.5.27-2 ; swap the image name for arm64 hosts.
CMD vs ENTRYPOINT: Lab Dockerfiles#
The primary multi-arch-safe images used in exercises are the alpine-based curl images. Alpine's official image is multi-arch.
- Base example (
cmd-vs-entrypoint/Dockerfile):FROM alpine:3.24, usesCMDwith a hardcoded proxy URL. my-curl:1.0(my-curl/Dockerfile):FROM alpine:3.24, usesCMD ["curl", "-x", "http://prx:3128", ...]— targets the university proxy by default, with a commented-out variant forhost.docker.internalwhen running a local Docker proxy.my-curl:2.0(parametrable) (my-curl/parametrable/Dockerfile): SwitchesCMDtoENTRYPOINT ["curl", "-x", "http://prx:3128", ...], making the target URL an argument passed atdocker runtime.
University Proxy Configuration#
For students whose client Docker daemon needs to pull through the university cache (cache-ili.univ-artois.fr), the daemon-level mirror approach is the cleanest :
/etc/docker/daemon.json
{
"registry-mirrors": ["http://cache-ili.univ-artois.fr:80/proxy_cache/"],
"insecure-registries": ["cache-ili.univ-artois.fr:80"]
}
Then restart Docker: sudo systemctl restart docker. This makes all docker pull commands transparently route through the cache without changing image names.
For proxy settings inside Dockerfile builds, ENV is preferred over --build-arg when the proxy is always needed, because ENV persists across all subsequent RUN layers .
Key Source Files#
| File | Purpose |
|---|---|
proxy.adoc | Full proxy configuration lecture (university mirror + HTTP proxy options) |
entrypoint.adoc | CMD vs ENTRYPOINT lecture, includes Squid proxy launch command |
squid.conf | Minimal Squid ACL config used in the sub-chapter notes |
cmd-vs-entrypoint/squid.conf | Identical config in the code-samples tree |
cmd-vs-entrypoint/Dockerfile | Base curl image (CMD form) |
my-curl/Dockerfile | my-curl:1.0 — CMD with proxy |
my-curl/parametrable/Dockerfile | my-curl:2.0 — ENTRYPOINT with proxy |
intro.adoc | Buildx / multi-arch context (ARM, RISC-V) |