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;








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










share|improve this question

















  • 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

















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










share|improve this question

















  • 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













0












0








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










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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












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
);



);













draft saved

draft discarded


















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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript