Linux / Home Lab

Docker notes and best practices

Practical Docker notes covering ephemeral containers, multi-stage builds and networking.

Docker notes and best pratice

Create ephemeral containers

The image defined by your Dockerfile should generate containers that are as ephemeral as possible. Ephemeral means that the container can be stopped and destroyed, then rebuilt and replaced with an absolute minimum set up and configuration.

Multi stage build seem useful

https://docs.docker.com/build/building/multi-stage/

If your container needs a hsot entry

docker run -d \
--name wordpress \
-p 8080:80 \
--add-host yourdomain.com:127.0.0.1 \
wordpress