earthly / earthly

Super simple build framework with fast, repeatable builds and an instantly familiar syntax – like Dockerfile and Makefile had a baby.
https://earthly.dev
Mozilla Public License 2.0
11.33k stars 398 forks source link

WITH DOCKER building images twice #1332

Open alexcb opened 2 years ago

alexcb commented 2 years ago

reported via slack

FROM alpine
RUN apk add uuidgen

image:
    ARG FUU=$(echo bar)
    RUN echo "image build: $(uuidgen)"
    RUN echo text > FILE

dind:
    WITH DOCKER --load img:latest=+image
        RUN docker run --rm -i img cat FILE
    END

then run earthly prune -a && earthly -P +dind

              +image | --> RUN echo "image build: $(uuidgen)"
              +image | image build: b47e043a-d44e-4cd1-a255-7d8c323dff41         <------ first here
              +image | --> RUN echo text > FILE
               +base | fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
               +base | fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
               +base | (1/2) Installing libuuid (2.37-r0)
               +base | (2/2) Installing uuidgen (2.37-r0)
               +base | Executing busybox-1.33.1-r3.trigger
               +base | OK: 6 MiB in 16 packages
              +image | image build: ec3065fd-bcef-4bfa-9866-f2912a86461a          <----- second here

However, when one runs earthly -P --no-cache +dind, it's only built once.

vladaionescu commented 2 years ago

I imagine that client conversion parallelism is off? That should rule that possibility out.

atonal commented 2 years ago

I imagine that client conversion parallelism is off? That should rule that possibility out.

@vladaionescu it is off in this case.