-
Bug
-
Resolution: Duplicate
-
Minor
-
None
I noticed today while trying something like the below code that cat just gets passed to the entrypoint that the image was built with. I think that it is the container = dockerClient.run(env, step.image, step.args, ws, volumes, volumesFromContainers, envReduced, dockerClient.whoAmI(), /* expected to hang until killed */ "cat"); line. Would it be better to override the entrypoint=/bin/cat instead of passing cat as the argument?
My current workaround is to build a custom image and set the CMD line in the docker file instead of having the entrypoint set.
def terraform(String tfArgs) { def dockerArgs = "-v ${workingDirectory}/:${tempDirectory}/ \ -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY " def dockerBuildImage = docker.image("hashicorp/terraform:${TF_VERSION}").inside(dockerArgs) { sh "echo Starting Terraform with args: ${tfArgs}" sh "/bin/terraform ${tfArgs}" } // sh "docker run --rm -v ${workingDirectory}/:${tempDirectory}/ -w=${tempDirectory}/ -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY hashicorp/terraform:${TF_VERSION} ${tfArgs}" }
- duplicates
-
JENKINS-37987 Image.inside fails for images specifying ENTRYPOINT
- Resolved
- relates to
-
JENKINS-41316 docker.image('my-image').inside{...} no longer honors Dockerfile "entrypoint" since version 1.8
- Reopened