💾 Archived View for ibannieto.info › stuff › containers.gmi captured on 2023-06-16 at 16:17:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-03-20)

-=-=-=-=-=-=-

ibannieto's capsule

Home

Containers

TO BE DONE

Docker

Steps to write a container image using Docker.

Write the Dockerfile:


Build and (locally) tag the container:

docker build -t molly:latest .

Tag again the container with the private registry:

docker tag molly:latest k3d-dev-local-registry:35387/molly:latest

Push the final container to the private registry:

docker push k3d-dev-local-registry:35387/molly:latest

Use cache while build:

DOCKER_BUILDKIT=1 docker build -t molly:latest .

Run the container using the local image:

docker run --rm -p 1965:1965 molly:latest

Run the container using the private image:

docker run --rm -p 1965:1965 k3d-dev-local-registry:35387/molly:latest

Podman

TO BE DONE

Tips

Look inside a container image:

dive molly:latest


Manually prune/delete all:

docker system prune
docker volume prune
docker network prune

Prune (delete) all:

docker system prune -a

Write two Dockerfiles, one for development and another one for production purposes:


Final files:

Dockerfile.development
Dockerfile.production

Build the container using the production file:

docker build -f Dockerfile.development -t molly:latest .

Back