0

I am new to docker and I just wanted to copy the shellscript inside the container and I wanted to execute the shellscript.

Dockerfile:

FROM amazonlinux

WORKDIR /opt

ADD ./test_Install.sh /opt/test_Install.sh

RUN chmod 777 /opt/test_Install.sh

WORKDIR /

RUN ./test_Install.sh

Build image: docker build -t "testinstallscript:dockerfile" .

When I use the command "docker build -t "testinstallscript:dockerfile" ." I get the following error:

standard_init_linux.go:178: exec user process caused "no such file or directory"

The command '/opt/test_Install.sh' returned a non-zero code: 1

Can anyone tell me what i am doing wrong here?

3
  • That's not what RUN is for, change it to ENTRYPOINT or CMD. Commented May 25, 2017 at 19:46
  • should be ./opt/test_Install.sh it seems Commented May 25, 2017 at 19:52
  • or better change WORKDIR to /opt but RUN still needs to be changed. Commented May 25, 2017 at 19:55

2 Answers 2

2

You need to change RUN ./test_Install.sh to utilize ENTRYPOINT or CMD. RUN executes commands in a new layer creating new image so use it when setting up your container.

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

Comments

-1

The below command worked: RUN bash /opt/test_install.sh

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.