1

I have a weird issue trying to execute several RUN commands sequentially.

The goal is to copy a folder. If I list the files in target folder:

  • it works in the same RUN with && ls
  • it does not work in another RUN

Here is the trace:

Step 6 : RUN cp -rf /app/httpd/htdocs/* /opt/rh/httpd24/root/var/www/html/ && ls /opt/rh/httpd24/root/var/www/html/
 ---> Running in 05842445d075
modules
tests
 ---> 05c51d512f60
Removing intermediate container 05842445d075
Step 7 : RUN ls /opt/rh/httpd24/root/var/www/html/
 ---> Running in aa217a8edc37
 ---> 095c9f8ac8e7

Do you have any idea what is going wrong?

4
  • post the Dockerfile Commented Oct 4, 2016 at 16:08
  • at the end of the build, do you have your files? Commented Oct 4, 2016 at 16:09
  • 1
    Nothing interesting in my Dockerfile. I think the problem is probably in the parent Dockerfile FROM rhscl/httpd-24-rhel7:2.4-10 Commented Oct 5, 2016 at 9:41
  • And no files at the end, which is the problem Commented Oct 5, 2016 at 13:11

1 Answer 1

1

As seen here, that could happen if the Dockerfile declared first a VOLUME.

Any file copied into a VOLUME would be discarded, as each build-step creates a new volume based on the image's content, discarding the volume that was used in the previous build step.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.