Hi, I’m creating my first workflow with a custom docker image that contains an entrypoint.
Just for conceptual purposes, all my Dockerfile does is pull the alpine image, and then call the entrypoint, which simply echo’s a string.
However, when I include the docker image in my workflow, I get the following error:
CircleCI was unable to run the job runner because we were unable to execute commands in build container.
This typically means that the build container entrypoint or command is terminating the container prematurely, or interfering with executed commands. Consider clearing entrypoint/command values and try again.
Is there something that I’m missing in my workflow/Dockerfile?
Dockerfile:
FROM alpine:3.8
LABEL com.circleci.preserve-entrypoint=true
ENTRYPOINT ["bash", "/entrypoint.sh"]
entrypoint.sh:
#!/bin/sh -l
echo "IN ENTRYPOINT"
config.yml:
version: 2.1
jobs:
build:
docker:
- image: nightfallai/nightfall_dlp:entrypoint_test_10
steps:
- setup_remote_docker
- run:
name: Code Has Arrived
command: |
ls -la
workflows:
test_only:
jobs:
- build
When I replace the ENTRYPOINT
with CMD
instead, the steps run (no build error occurs), but I don’t see the echo output anywhere, which seems to suggest that entrypoint.sh
is not being run. How can I achieve this with either ENTRYPOINT
/CMD
?
Thanks!