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}’

  • Is it possible to create named volume via Dockerfile during docker build?
  • How to install latest version of make in centos6.6 docker container
  • Dockerfile RUN vs run image and use /bin/bash provides different result
  • Creating bash script from Dockerfile strips comments
  • How to bind a port when using docker-py to create a service? [duplicate]
  • accessing the docker container for rabbitmq from ubuntu host
  • …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!!

  • Docker alpine image's basic commands are not working
  • Running 2 services
  • Gitlab-CI multi runner start docker container, scripts now work
  • curl syntax error: append couchdb document failed with “conflict”?
  • Can I have one Docker Swarm Manager and different clusters?
  • Docker - A clean tomcat image
  • 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.