Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build with --no-cache not work after v0.17.2 #5558

Closed
owanio1992 opened this issue Nov 30, 2024 · 2 comments · Fixed by #5563
Closed

build with --no-cache not work after v0.17.2 #5558

owanio1992 opened this issue Nov 30, 2024 · 2 comments · Fixed by #5563
Assignees
Labels
Milestone

Comments

@owanio1992
Copy link

owanio1992 commented Nov 30, 2024

I got issue in BUILDKIT v0.17.2, builder is ignore --no-cache parameter

builder

$ docker buildx ls
NAME/NODE      DRIVER/ENDPOINT                   STATUS    BUILDKIT   PLATFORMS
v0.16.0        docker-container                                       
 \_ v0.16.00    \_ unix:///var/run/docker.sock   running   v0.16.0    linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
v0.17.0        docker-container                                       
 \_ v0.17.00    \_ unix:///var/run/docker.sock   running   v0.17.0    linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
v0.17.1        docker-container                                       
 \_ v0.17.10    \_ unix:///var/run/docker.sock   running   v0.17.1    linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
v0.17.2        docker-container                                       
 \_ v0.17.20    \_ unix:///var/run/docker.sock   running   v0.17.2    linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
v0.18.0        docker-container                                       
 \_ v0.18.00    \_ unix:///var/run/docker.sock   running   v0.18.0    linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
default*       docker                                                 
 \_ default     \_ default                       running   v0.16.0    linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386


docker file

# syntax=docker/dockerfile:1

FROM ubuntu:24.04

RUN echo "543"

USER ubuntu

test command

when use BUILDKIT v0.16.0 ~ v0.17.1, --no-cache is work
RUN echo "543" is not CACHED

$ docker buildx build --builder v0.17.1 --no-cache .
[+] Building 1.1s (8/8) FINISHED                                                                                                                                                                                   docker-container:v0.17.1
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 113B                                                                                                                                                                                                   0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                                                                                                                              0.4s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5                                                                                                        0.0s
 => => resolve docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5                                                                                                                   0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:24.04                                                                                                                                                                        0.5s
 => [internal] load .dockerignore                                                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                                                        0.0s
 => CACHED [1/2] FROM docker.io/library/ubuntu:24.04@sha256:278628f08d4979fb9af9ead44277dbc9c92c2465922310916ad0c46ec9999295                                                                                                           0.0s
 => => resolve docker.io/library/ubuntu:24.04@sha256:278628f08d4979fb9af9ead44277dbc9c92c2465922310916ad0c46ec9999295                                                                                                                  0.0s
 => [2/2] RUN echo "543"  


when use BUILDKIT v0.17.2, --no-cache is not work
echo "543" is CACHED

$ docker buildx build --builder v0.17.2 --no-cache .
[+] Building 3.7s (9/9) FINISHED                                                                                                                                                                                   docker-container:v0.17.2
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 113B                                                                                                                                                                                                   0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                                                                                                                              2.4s
 => [auth] docker/dockerfile:pull token for registry-1.docker.io                                                                                                                                                                       0.0s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5                                                                                                        0.0s
 => => resolve docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:24.04                                                                                                                                                                        1.2s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                                                                          0.0s
 => local://context                                                                                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                                                                        0.0s
 => docker-image://docker.io/library/ubuntu:24.04@sha256:278628f08d4979fb9af9ead44277dbc9c92c2465922310916ad0c46ec9999295                                                                                                              0.0s
 => => resolve docker.io/library/ubuntu:24.04@sha256:278628f08d4979fb9af9ead44277dbc9c92c2465922310916ad0c46ec9999295                                                                                                                  0.0s
 => CACHED /bin/sh -c echo "543"   

same as v 0.18.0

$ docker buildx build --builder v0.18.0 --no-cache .
[+] Building 1.7s (7/7) FINISHED                                                                                                                                                                                   docker-container:v0.18.0
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 113B                                                                                                                                                                                                   0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                                                                                                                              1.0s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5                                                                                                        0.0s
 => => resolve docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:24.04                                                                                                                                                                        0.5s
 => local://context                                                                                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                                                                        0.0s
 => docker-image://docker.io/library/ubuntu:24.04@sha256:278628f08d4979fb9af9ead44277dbc9c92c2465922310916ad0c46ec9999295                                                                                                              0.0s
 => => resolve docker.io/library/ubuntu:24.04@sha256:278628f08d4979fb9af9ead44277dbc9c92c2465922310916ad0c46ec9999295                                                                                                                  0.0s
 => CACHED /bin/sh -c echo "543" 
@owanio1992 owanio1992 changed the title build with --no-cache not work build with --no-cache not work after v0.17.2 Nov 30, 2024
@Nta264

This comment has been minimized.

@crazy-max
Copy link
Member

Thanks for reporting, looks like #5517 introduced this regression (cc @jsternberg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants