-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Unable to use COPY --from , docker build trying to pull image #1977
Comments
Looks like your |
You probably want to add a new I'll close this issue, because I don't think there's a bug here, but feel free to continue the conversation |
But why then build on the https://circleci.com is okay?
It`s can be problem in machine or windows? |
Hm interesting; I can confirm it worked on Docker 17.09, but that's not by design: the Older versions of Docker failed to detect this situation, and just went ahead. Docker 17.09 seems to use docker build -t myimage -<<'EOF'
FROM busybox AS build-env
WORKDIR /app
RUN mkdir -p out && echo foo > out/CostsAnalyse.dll
WORKDIR /app
COPY --from=build-env /app/out/ .
EOF Which copies the file from the current stage (or "build-env"); docker run --rm myimage ls -la /app
total 16
drwxr-xr-x 1 root root 4096 Jul 4 13:06 .
drwxr-xr-x 1 root root 4096 Jul 4 13:18 ..
-rw-r--r-- 1 root root 4 Jul 4 13:06 CostsAnalyse.dll
drwxr-xr-x 2 root root 4096 Jul 4 13:06 out Given that we're still inside the FROM busybox AS build-env
WORKDIR /app
RUN mkdir -p out && echo foo > out/CostsAnalyse.dll
RUN cp -r /app/out/* . Note that current versions of Docker with buildkit enabled will produce a more useful error message; DOCKER_BUILDKIT=1 docker build -t myimage -<<'EOF'
FROM busybox AS build-env
WORKDIR /app
RUN mkdir -p out && echo foo > out/CostsAnalyse.dll
WORKDIR /app
COPY --from=build-env /app/out/ .
EOF Running the above produces:
|
Oh, but Windows doesn't support this function yet. |
Correct, BuildKit is unfortunately not yet supported on Windows, but for this Dockerfile to work, it's not needed; if you intended to make a multi-stage build, you need to add a |
Well, BuildKit is not supported for Windows containers/images; I see you're running docker desktop with Linux images;
So buildkit should work |
which is how I understand docker/cli#1977 (comment)
Description
I have a Dockerfile like this:
and when i`m run COPY --from=build-env /app/out/ . i have been get the error:
invalid from flag value build-env: pull access denied for build-env, repository does not exist or may require 'docker login'
Steps to reproduce the issue:
Describe the results you received:
i get the error: invalid from flag value build-env: pull access denied for build-env, repository does not exist or may require 'docker login', after running COPY --from=build-env /app/out/ .
Describe the results you expected:
I am expecting that the build will work with the syntax --from=build .
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Running on Windows 10.
Circle CLI build that assemble without any error.
The text was updated successfully, but these errors were encountered: