1

I´m executing following command:

sudo docker run IMAGE bash ~/commands.sh

where IMAGE is my docker image and commands.sh a script inside the container.

When starting the container with "docker run", I want to execute the script. But it doesn´t work. I get the following error-status:

Exited (127) Less than a second ago

This error-status means, it doesn´t know the command. Can you tell me where my mistake is?

1
  • Does your image actually contain bash? (Many Alpine-based images won't.) Commented Oct 11, 2019 at 15:54

1 Answer 1

2

I would assume that your local bash (running on the host system) expands the ~ before it reaches the running docker container. Have you tried using an absolute path here?

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

1 Comment

Please edit your question to contain all these different ways along with your attempts to debug the problem

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.