Docker Community Forums

Share and learn in the Docker community.

Docker build fails once USER=<valid user> instruction is run

(Pheitman) #1

I am having a strange problem on one of my docker systems. The Docker build fails when I try to run a command that requires ncurses after I have executed the USER= instruction. That is, for this docker engine if I have a Dockerfile that has the following lines in it (after adding the user to the image)

USER newuser
RUN ls

I get the following error

Step 14 : USER newuser
—> Using cache
—> 75d05e3449ad
Step 15 : RUN ls
—> Running in feef8d7ca2c7
/bin/sh: error while loading shared libraries: cannot open shared object file: Permission denied
The command ‘/bin/sh -c ls’ returned a non-zero code: 127
make[1]: *** [build] Error 127
make[1]: Leaving directory `/opt/phde/jenkins/jenkins_home/workspace/Publish-unique-tag.pheitman’
make: *** [build-image-db-manager] Error 2

I have another docker system that appears to be configured identically (same distribution, same kernel, same version of docker, same docker info, selinux is disabled on both, etc). On the second system it runs fine. I can’t figure out why. Any ideas?