So I’m trying to use Docker buildkit features such as parallelization on my local machine and it does not work, what am I missing here? I installed docker using Docker documentation
What am I trying to do? I’m trying to build this Dockerfile:
FROM alpine AS build1 RUN touch /opt/binary1 RUN sleep 10 FROM alpine AS build2 RUN touch /opt/binary2 RUN sleep 10 FROM alpine as final COPY --from=build1 /opt/binary1 /opt/ COPY --from=build2 /opt/binary2 /opt/
And build it using this command:
time DOCKER_BUILDKIT=1 sudo docker build .
As I understood this should run in parallel, but it doesn’t.
I’ve stumbled upon this by watching this video (from minute 5):
My OS version is:
20.04.5 LTS (Focal Fossa)
Client: Docker Engine - Community Version: 20.10.21 API version: 1.41 Go version: go1.18.7 Git commit: baeda1f Built: Tue Oct 25 18:02:21 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.21 API version: 1.41 (minimum version 1.12) Go version: go1.18.7 Git commit: 3056208 Built: Tue Oct 25 18:00:04 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.10 GitCommit: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
I’ve tried this on multiple Ubuntu versions (using cloud provider) and the result is the same, what am I missing?
Buildkit enabled - Dockerfile not building in parallel