Jenkins build parameter not working in quotes

I’m trying to issue a jenkins shell command with docker looks like this:

docker run -v ${env.param1}:/workspace –privileged=true app sh -c ‘python app.py –option ${env.param1}’

  • pg_restore in postgres docker container
  • What solutions exist for lightweight version control of an entire system image?
  • GDB problems inside docker
  • Dockerized emacs not loading extensions
  • How to dockerize a node.js talking to a local mongodb
  • Websocket not attaching into docker container
  • …and the result looks like this:

    docker run -v actual.param1:/workspace –privileged=true app sh -c ‘cd folder && python app.py –option ${env.param2}’

    The first environment parameter ${env.param1} is successfully replaced with actual parameter, but the second one ${env.param2} is not. Seems to me that because the second ${env.param2} is inside a single quote, jenkins is not replacing the parameter.

    Thank you for reading and I would appreciate your help!!

  • How to expose docker container from Rancher's private network?
  • Is it possible to create image from file on docker host using docker API?
  • Docker with multiple exposed ports
  • how to mount the nginx docker container into host using Ansible Playbook?
  • How to run docker with experimental functions on Ubuntu 16.04
  • Need for service discovery for docker engine swarm mode
  • One Solution collect form web for “Jenkins build parameter not working in quotes”

    docker run -v ${env.param1}:/workspace –privileged=true app sh -c ‘python app.py –option ${env.param1}’

    You are passing ${env.param1} inside of '‘s (single quotes), therefore it is not being evauluated, change your command to use doublequotes instead:

    docker run -v ${env.param1}:/workspace –privileged=true app sh -c “python app.py –option ${env.param1}”

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.