You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output for the from line should not change between evocations, or if there is a good reason for it, the output should make that reason much clearer. At the moment, it is very odd, that CACHED shows up when running with --no-cache, but does not show up normally, even when the rest of the build is indeed CACHED.
spkane
changed the title
**FROM** line output inconsistent and confusing when using or disabling the build cache
FROM line output inconsistent and confusing when using or disabling the build cache
Nov 15, 2024
Hi @spkane ,
I think this is not even a issue. I have checked. If you do docker system prune and then run docker build --no-cache . then it doesn't print
it shows below output. $ docker build --no-cache . ... => [ 1/13] FROM docker.io/library/alpine:3.20@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb752 0.0s ...
By printing CACHED in front of FROM statement is that it is already cached and picking it from there. If you see from command is fetching image from docker hub right there is no way it could skip caching it. Image is building block of docker containers. So you put --no-cache or not the images which will you fetch in dockerfile those will be cached and stored in your local.
On the second time running this command again then it rebuild the image from scratch because except from all other layers are not cached due to no-cache flag.
I hope this justifies the issue stated above.
Please close this issue.
@octocamocoder47 Maybe my description wasn't clear enough. I am not confused about WHY it is saying CACHED. I am confused about why it isn't saying CACHED in BOTH use cases. If the base image is CACHED, it only says CACHED when you use --no-cache which is extremely odd. It should still say CACHED when using the build cache if the base image is indeed CACHED, yet it does not.
Description
FROM line output inconsistent and confusing when using or disabling the build cache.
Reproduce
Expected behavior
The output for the from line should not change between evocations, or if there is a good reason for it, the output should make that reason much clearer. At the moment, it is very odd, that CACHED shows up when running with
--no-cache
, but does not show up normally, even when the rest of the build is indeed CACHED.docker version
Client: Version: 26.1.3 API version: 1.45 Go version: go1.21.10 Git commit: b72abbb Built: Thu May 16 08:30:38 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.35.1 (173168) Engine: Version: 27.3.1 API version: 1.47 (minimum version 1.24) Go version: go1.22.7 Git commit: 41ca978 Built: Fri Sep 20 11:41:19 2024 OS/Arch: linux/arm64 Experimental: true containerd: Version: 1.7.21 GitCommit: 472731909fa34bd7bc9c087e4c27943f9835f111 runc: Version: 1.1.13 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: