Skip to content

Latest commit

 

History

History
57 lines (28 loc) · 1.27 KB

2.building_container.md

File metadata and controls

57 lines (28 loc) · 1.27 KB

Building container images

  1. Build the container with DinD

    Query the list of images on the host:

    docker image ls

    Start the docker dind image with privileged flag:

    docker run --privileged -it -v "/Users/liviucostea/code/github.com/lcostea/containers-workshop/kustomize":/project docker:26.0.0-dind-alpine3.19 /bin/sh

    Start the docker daemon inside, insecured, listening on localhost:

    dockerd --host tcp://localhost:2375 &

    export DOCKER_HOST=tcp://localhost:2375

    Query the list of images from the new docker daemon:

    docker image ls

    Build the container:

    cd /project

    time docker build -t kustomize-local:0.1.0 -f kustomize.Dockerfile .

  2. Build containers with podman (MacOS - VM, Windows - WSLv2)

    Stop docker desktop from UI

    docker version

    podman version

    podman machine init

    podman machine start

    podman image ls

    podman build -t kustomize-podman-local:0.1.0 -f kustomize.Dockerfile .

    podman image ls

    podman system prune

    export 'DOCKER_HOST='

    podman machine stop