I'm configuring an entrypoint to be executed after the container is started:
COPY entrypoint.sh /entrypoint.sh
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT exec /entrypoint.sh
However, I'm not able to see the output of entrypoint.sh
execution when docker-compose up
.
The only output is:
service exited with code 2
The container is killed so I cannot do docker logs <container_id>
I've tried with docker events
command but I don't see any logs related to entrypoint.sh
.
I know the entrypoint file has an error, but I'd like to see the output of the execution.
Any ideas?
docker-compose up -d
option so the container starts in the foreground and you see its output, but I'm guessing you're already doing this. – SharolynsharonENTRYPOINT ["/entrypoint.sh"]
avoids invoking a shell entirely. – SharolynsharonENTRYPOINT
toCMD
(permanently),docker-compose run yourcontainer bash
, and run/entrypoint.sh
by hand at an interactive shell prompt. You won't be process ID 1 but you'll otherwise be inside the container environment, and you can try things likesh -x /entrypoint.sh
to trace the script execution. – Sharolynsharon