question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variables expansion in "Docker xxx" build step

See original GitHub issue

I’m trying to set up Jenkins job to build/push images for different projects. So I created the Job which is downstream for several projects. Upstream jobs pass path to Dockerfile, repository name and image tag via Parameterized Build/Trigger Plugins. But Docker Plugin fails to expand those vars and to find Dockerfile respectively:

[...]
Docker Build
Docker Build: building image at path /${WORKSPACE}/${DOCKERFILE_DIRECTORY}
ERROR: Build step failed with exception
java.lang.IllegalArgumentException: Dockerfile does not exist
[...]

Is there a way to use Env vars with this Plugin? Or can you add this possibility, pls?

ps: Jenkins is v2.19.3, Docker Plugin is v0.16.2

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:9

github_iconTop GitHub Comments

3reactions
aleksandarknezeviccommented, Dec 6, 2017

Seems like it is solved in Docker plugin version 1.1! Now it is possible to push imagename:${BUILD_NUMBER} \o/.

2reactions
sostercommented, Nov 2, 2017

+1 Would be super useful

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variables expansion in "Docker xxx" build step - - Bountysource
I'm trying to set up Jenkins job to build/push images for different projects. So I created the Job which is downstream for several...
Read more >
How to use Docker Build Args and Environment Variables
Today, we will discuss docker ARG and ENV variables in detail. We will go through various examples of dockerfile and docker compose for...
Read more >
dockerfile - Docker variable expansion - Stack Overflow
The ENV instruction sets the environment variable to the value . This value will be in the environment of all descendant Dockerfile commands...
Read more >
Compose file version 2 reference - Docker Documentation
Add build arguments, which are environment variables accessible only during the build process. First, specify the arguments in your Dockerfile:.
Read more >
Use docker images built in previous stages - GitLab.org
build : stage: build image: xxx script: # generate DOCKER_IMAGE_TAG_REF & the SHA is in /digest-file as a result of the image build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found