-
Notifications
You must be signed in to change notification settings - Fork 87
Simple bash command fails during build #618
Copy link
Copy link
Closed
Description
Due to a failed build I have stripped down a simple Dockerfile that should run an ls command on a bash shell to list some directories, but instead fails. I tried to alter the RUN command but nothing seems to help.
The Dockerfile contains:
FROM debian:stable
RUN ["/bin/bash", "-c", "ls -d /usr/bin/[a-Z]*"]
I run a debian stable clean install with:
ii docker-ce 5:18.09.3~3-0~debian-stretch amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:18.09.3~3-0~debian-stretch amd64 Docker CLI: the open-source application container engine
Doing a build will have the unexpected result:
Sending build context to Docker daemon 8.704kB
Step 1/2 : FROM debian:stable
---> c04b519eaefa
Step 2/2 : RUN ["/bin/bash", "-c", "ls -d /usr/bin/[a-Z]*"]
---> Running in 4629f06f6b47
ls: cannot access '/usr/bin/[a-Z]*': No such file or directory
The command '/bin/bash -c ls -d /usr/bin/[a-Z]*' returned a non-zero code: 2
Also manually running the command on a normal shell works with:
/bin/bash -c "ls -d /usr/bin/[a-Z]*"
and fails as expected with:
/bin/sh -c "ls -d /usr/bin/[a-Z]*"
Thanks,
Alex
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels