Open netsandbox opened 2 weeks ago
It looks like this changed between classic docker build
and the newer BuildKit-based docker build
, as I get different results by setting DOCKER_BUILDKIT to 0 or 1 in the environment before invoking docker build
.
We only care about DOCKER_BUILDKIT=1 since we are moving to the new standard.
It didn't work with DOCKER_BUILDKIT=0, but it works with DOCKER_BUILDKIT=1
$ DOCKER_BUILDKIT=0 docker build -f Containerfile .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
environment-variable.
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM scratch
--->
Step 2/2 : COPY nonexistingfile.* .
COPY failed: no source files were specified
$ DOCKER_BUILDKIT=1 docker build -f Containerfile .
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Containerfile
#1 transferring dockerfile: 79B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load build context
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [1/1] COPY nonexistingfile.* .
#4 CACHED
#5 exporting to image
#5 exporting layers done
#5 writing image sha256:810b55b8671ad59944575835a0ddae1ea28ef3c85bed153df3441f7a08e504f7 done
#5 DONE 0.0s
Inconsistent behavior with docker when using COPY and non existing file.
While docker builds the above Containerfile, podman fails with:
Steps to reproduce the issue:
Describe the results you received:
Podman fails when using COPY with non existing files.
Describe the results you expected:
Podman should build when using COPY with non existing files, as docker does.
Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:Output of
docker version
:*Output of `cat /etc/release`:**
Output of
uname -a
:Output of
cat /etc/containers/storage.conf
: