Hands-on task
The host network and the none network
Two containers need to move to special network modes:
agent(izzylab/minihttp:1,NAME=agent,PORT=9100) is a metrics exporter. Monitoring expects it right in the server's network:curl http://127.0.0.1:9100/on the server answersagent ok, and without publishing ports (-p) — the container runs in the host's network namespace;crunch(busybox:1.36, an endlesssleeploop) processes exports and needs no network at all: there must be no network address inside except loopback onlo.
Right now both are in the default network. Recreate them with the same names, images and settings.
The lab has its own Docker with no internet access; the images are already loaded: izzylab/minihttp:1, alpine:3.21, busybox:1.36, nginx:1.27-alpine. izzylab/minihttp is a tiny HTTP service on port 8080: GET / answers <NAME> ok, GET /call itself goes to http://<UPSTREAM>/ and answers <NAME> -> <the neighbor's reply> (or 502), GET /env shows its settings. It is configured with the environment variables NAME, PORT, BIND (the address it listens on) and UPSTREAM.
- docker network host
- docker network none