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?
Change your entrypoint to use the full path to the script:
ENTRYPOINT ["/home/user1/script.sh"]