jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-73979] Docker entrypoint race condition

Open
#722 1 comment 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

We run our jenkins agent dockerized, and enabled docker in docker in the jenkins agent.

Our pipeline uses an image, which has included different binaries for building code.

In our image we use

ENTRYPOINT ["/entrypoint.sh"]

CMD ["/bin/bash"]

 

and in the entrypoint.sh we basically use -e variable to determine what to set up for the pipeline.

 

I found that first of all the error came up after docker top

$ docker top 3cd0fbfadba4678ef071da8b33473f34e9fc815d745179f812f6f5eb11b0065b -eo pid,comm

ERROR: The container started but didn't run the expected command. Please double check your ENTRYPOINT does execute the command passed as docker run argument

but this is not too bad. I don't think it hurts the run badly.

 

However, I do find anomaly, that perhaps entrypoint.sh has not yet finished, and when I check on the version of my build runtime, it's on a wrong version (not really following what I pass in for the docker run, so I suspect entrypoint.sh has not yet completed).

 

The docker declaration is just a simple:

 

agent {

docker {
image "image:version"
args "-e RUNTIME_VERSION=12"
{
}

 


If at the steps {} I put in a sleep 3, then the version will be fetched out correctly (assuming entrypoint.sh has completed running).

 

I looked through a few tickets, and what I think is:

1. We are in dind situation, so I think the error from docker top is acceptable, and it does not really hurt the flow

2. I suspect entrypoint.sh has not yet completed

 

Has anyone got similar situations? Any methods you tried?

 

---
Originally reported by hchiang, imported from: Docker entrypoint race condition


  • status: Open
  • priority: Major
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

We run our jenkins agent dockerized, and enabled docker in docker in the jenkins agent.

Our pipeline uses an image, which has included different binaries for building code.

In our image we use
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]
 
and in the entrypoint.sh we basically use -e variable to determine what to set up for the pipeline.
 
I found that first of all the error came up after docker top


$ docker top 3cd0fbfadba4678ef071da8b33473f34e9fc815d745179f812f6f5eb11b0065b -eo pid,comm

ERROR: The container started but didn't run the expected command. Please double check your ENTRYPOINT does execute the command passed as docker run argument


but this is not too bad. I don't think it hurts the run badly.
 
However, I do find anomaly, that perhaps entrypoint.sh has not yet finished, and when I check on the version of my build runtime, it's on a wrong version (not really following what I pass in for the docker run, so I suspect entrypoint.sh has not yet completed).
 
The docker declaration is just a simple:
 



agent {

docker {
image "image:version"
args "-e RUNTIME_VERSION=12"
{
}

 



If at the steps {} I put in a sleep 3, then the version will be fetched out correctly (assuming entrypoint.sh has completed running).
 
I looked through a few tickets, and what I think is:
1. We are in dind situation, so I think the error from docker top is acceptable, and it does not really hurt the flow
2. I suspect entrypoint.sh has not yet completed
 
Has anyone got similar situations? Any methods you tried?
 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.