2

My Dockerfile:

FROM centos:7.2
COPY gateway-deploy-1.1-SNAPSHOT /home/admin/gateway/
COPY entrypoint.sh /home/admin/entrypoint.sh
RUN chmod +x /home/admin/entrypoint.sh
EXPOSE 12366
VOLUME ["/home/admin/logs"]
ENTRYPOINT ["sh", "/home/admin/entrypoint.sh"]

When I start the container, entrypoint.sh should be executed, but the system prompts "No such file or directory". I tried to change the startup command to "/bin/bash" and then went to the container to see that the file exists.

Why is this problem? I have tried to make images many times, but this problem has always existed.

4
  • And did you find this file when manually strafing thrgough container? Commented Dec 2, 2018 at 14:51
  • I can find all of files I added in container Commented Dec 2, 2018 at 15:02
  • Maybe try ENTRYPOINT["/bin/bash", ... ] ? Commented Dec 2, 2018 at 15:05
  • 1
    Your Dockerfile is fine (apart from the tag centos:7.2 which isn't available (at least not for me, I had to use centos:latest). Presumably, entrypoint.sh references another file which cannot be found - please post the contents of entrypoint.sh Commented Dec 2, 2018 at 15:07

1 Answer 1

1

Since I mounted an empty directory from the host to the path /home/admin when I started the container, the file was overwritten. So this is not a problem, but my mistake.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.