We are able to run the docker container locally with docker file having relative path in ENTRYPOINT:

USER user1

WORKDIR /home/user1

ADD script.sh $HOME/script.sh

ENTRYPOINT ["./script.sh"]

When the same docker image(of above docker file) is launched from ansible tower using below task:

- name: Run docker container
  command: docker run --rm -e arg={{value}} 111122223333.dkr.ecr.us-east-1.amazonaws.com/someteam:v.1

We get file not found error for script.sh

How to resolve this error?


Problem could be that it is not an executable chmod should do it and also maybe I'd change ENTRYPOINT to CMD as default entrypoint is /bin/sh -c

| improve this answer | |
  • 1
    CMD ["./script.sh"] – overexchange Aug 8 '19 at 22:19
  • Did it work? I hope yes :) – Dominik Matis Aug 9 '19 at 0:07
  • Can you explain why CMD [".script.sh"] works with relative path? using ansible? here chmod is not the problem. Giving ENTRYPOINT ["/a/b/script.sh"] works but not relative path – overexchange Aug 9 '19 at 0:10
  • No it didn't work – overexchange Aug 9 '19 at 0:34
  • 1
    $PATH of ansible env? – overexchange Aug 9 '19 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.