Not able to execute RUN commands in Dockerfile
Contents of the Dockerfile:
FROM XYZ MAINTAINER ABC RUN echo "hello world" EXPOSE 80 ENTRYPOINT ["/usr/sbin/httpd","-D","FOREGROUND"]
When I try to build an image from this file, I see the following:
permission denied Removing intermediate container
when docker tries to execute the RUN command
- This error is irrespective of the content of the RUN command.
- Removing it ensures the build completes without issues.
- I am able to build from the same docker file and image on another host.
- “docker info” produced similar information on both machines.
How can I debug this further to see what the issue is?
Update (in response to the comments below):
- I have been able to build the same image (and others) on this instance before
- The issue occurred irrespective of the base image used
- The issue was specific to this one instance which is running CentOS
- The user I was logged in as was different from the user the daemon was running as (root)
Assuming the issue may have been because of the user mismatch, I changed to root and tried the command. It went through without issues. Then, I changed back to the original user, removed the image and tried again: it went through again! The original issue is not reproducible anymore.