Jenkins declarative pipeline - pass command arguments to docker runjenkins pipeline docker build on docker agentSetting build args for dockerfile agent using a Jenkins declarative pipelineDeclarative Jenkins pipeline and DockerRestrict Jenkins declarative pipeline agents at the server level?Template docker agent in jenkins Declarative pipelineAdding additional run arguments to docker container in Jenkins PipelineInsert a config file into a declarative Jenkins pipeline Docker container from DockerfileJenkins Docker Declarative .withRunRun sudo within Jenkins dockerfile pipelineHow to build on remote Docker server with Jenkins declarative pipeline?
What are "the high ends of castles" called?
How does mathematics work?
MITM on HTTPS traffic in Kazakhstan 2019
What do Unicorns want?
Langton's Ant Periodic Behavior
Why is there an extra "t" in Lemmatization?
Is it ethical to tell my teaching assistant that I like him?
How can electronics on board JWST survive the low operating temperature while it's difficult to survive lunar nights?
What does the following chess proverb mean: "Chess is a sea where a gnat may drink from and an elephant may bathe in."
Can a ring have no zero divisors while being non-commutative and having no unity?
Is it better to deliver many low-value stories or few high-value stories?
Has Iron Man made any suit for underwater combat?
How to create quantum circuits from scratch
Did Don Young threaten John Boehner with a 10 inch blade to the throat?
Is it better to merge "often" or only after completion do a big merge of feature branches?
How much did NASA help with the making of "First Man"?
How can I remove studs and screws from the inside of drywall when installing a pocket door without needing to do paint and patch work on both sides?
Host telling me to cancel my booking in exchange for a discount?
Quickest way to move a line in a text file before another line in a text file?
Piece of fabric in planter, how to use it?
Killing a star safely
Reflect IR beam off reflector instead of emitting straight to TSOP receiver
Is there an English word to describe when a sound "protrudes"?
Plotting maxima within a simplex
Jenkins declarative pipeline - pass command arguments to docker run
jenkins pipeline docker build on docker agentSetting build args for dockerfile agent using a Jenkins declarative pipelineDeclarative Jenkins pipeline and DockerRestrict Jenkins declarative pipeline agents at the server level?Template docker agent in jenkins Declarative pipelineAdding additional run arguments to docker container in Jenkins PipelineInsert a config file into a declarative Jenkins pipeline Docker container from DockerfileJenkins Docker Declarative .withRunRun sudo within Jenkins dockerfile pipelineHow to build on remote Docker server with Jenkins declarative pipeline?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Is there a way to pass parameters to the docker run entrypoint comand?
what i mean is, for the run command I need to have something like this:
docker run myImage --host.url.expected=http://url --host.url.actual=http://url
Currently the pipeline that I've build would look like:
agent
dockerfile
args '--host.url.expected=$params.EXPECTED --host.url.actual=$params.ACTUAL'
but like this, will actually do something like:
docker run --host.url.expected=http://url --host.url.actual=http://url myImage
causing the script to fail of course
is there a way to achieve what I need?
Ideally still using a declarative pipeline... with as less boilerplate as possible
Let me know if you need more details, I can add the whole jenkinsfile / dockerfile if needed
docker jenkins jenkins-pipeline
add a comment |
Is there a way to pass parameters to the docker run entrypoint comand?
what i mean is, for the run command I need to have something like this:
docker run myImage --host.url.expected=http://url --host.url.actual=http://url
Currently the pipeline that I've build would look like:
agent
dockerfile
args '--host.url.expected=$params.EXPECTED --host.url.actual=$params.ACTUAL'
but like this, will actually do something like:
docker run --host.url.expected=http://url --host.url.actual=http://url myImage
causing the script to fail of course
is there a way to achieve what I need?
Ideally still using a declarative pipeline... with as less boilerplate as possible
Let me know if you need more details, I can add the whole jenkinsfile / dockerfile if needed
docker jenkins jenkins-pipeline
1
Could you make host.url.expected and host.url.actual environment variables and have your command reading them, them then pass something like -args '-e -host_url_expected=url -e host_url_actual=url myImage'
– Miguel Marques
Mar 26 at 15:43
works as a workaround, but is not what I am looking for
– Alex
Mar 26 at 17:54
add a comment |
Is there a way to pass parameters to the docker run entrypoint comand?
what i mean is, for the run command I need to have something like this:
docker run myImage --host.url.expected=http://url --host.url.actual=http://url
Currently the pipeline that I've build would look like:
agent
dockerfile
args '--host.url.expected=$params.EXPECTED --host.url.actual=$params.ACTUAL'
but like this, will actually do something like:
docker run --host.url.expected=http://url --host.url.actual=http://url myImage
causing the script to fail of course
is there a way to achieve what I need?
Ideally still using a declarative pipeline... with as less boilerplate as possible
Let me know if you need more details, I can add the whole jenkinsfile / dockerfile if needed
docker jenkins jenkins-pipeline
Is there a way to pass parameters to the docker run entrypoint comand?
what i mean is, for the run command I need to have something like this:
docker run myImage --host.url.expected=http://url --host.url.actual=http://url
Currently the pipeline that I've build would look like:
agent
dockerfile
args '--host.url.expected=$params.EXPECTED --host.url.actual=$params.ACTUAL'
but like this, will actually do something like:
docker run --host.url.expected=http://url --host.url.actual=http://url myImage
causing the script to fail of course
is there a way to achieve what I need?
Ideally still using a declarative pipeline... with as less boilerplate as possible
Let me know if you need more details, I can add the whole jenkinsfile / dockerfile if needed
docker jenkins jenkins-pipeline
docker jenkins jenkins-pipeline
asked Mar 26 at 13:23
AlexAlex
2563 silver badges10 bronze badges
2563 silver badges10 bronze badges
1
Could you make host.url.expected and host.url.actual environment variables and have your command reading them, them then pass something like -args '-e -host_url_expected=url -e host_url_actual=url myImage'
– Miguel Marques
Mar 26 at 15:43
works as a workaround, but is not what I am looking for
– Alex
Mar 26 at 17:54
add a comment |
1
Could you make host.url.expected and host.url.actual environment variables and have your command reading them, them then pass something like -args '-e -host_url_expected=url -e host_url_actual=url myImage'
– Miguel Marques
Mar 26 at 15:43
works as a workaround, but is not what I am looking for
– Alex
Mar 26 at 17:54
1
1
Could you make host.url.expected and host.url.actual environment variables and have your command reading them, them then pass something like -args '-e -host_url_expected=url -e host_url_actual=url myImage'
– Miguel Marques
Mar 26 at 15:43
Could you make host.url.expected and host.url.actual environment variables and have your command reading them, them then pass something like -args '-e -host_url_expected=url -e host_url_actual=url myImage'
– Miguel Marques
Mar 26 at 15:43
works as a workaround, but is not what I am looking for
– Alex
Mar 26 at 17:54
works as a workaround, but is not what I am looking for
– Alex
Mar 26 at 17:54
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55358282%2fjenkins-declarative-pipeline-pass-command-arguments-to-docker-run%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55358282%2fjenkins-declarative-pipeline-pass-command-arguments-to-docker-run%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Could you make host.url.expected and host.url.actual environment variables and have your command reading them, them then pass something like -args '-e -host_url_expected=url -e host_url_actual=url myImage'
– Miguel Marques
Mar 26 at 15:43
works as a workaround, but is not what I am looking for
– Alex
Mar 26 at 17:54