Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48042

Cannot give build-arg or environment variable to docker.build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • docker-workflow-plugin
    • None
    • docker-ce-17.06.0

      I have a Dockerfile like this:

      ARG REGISTRY_URL=machine:5000
      ARG PI_VERSION=0.4
      FROM ${REGISTRY_URL}/java:${PI_VERSION}

      I cannot set REGISTRY_URL, neither by build-arg nor environment variable.

      In jenkinsfile:
      def dockerImage = docker.build "${VAR_DOCKER.registry}${item.name}:${item.versionDocker}"
      Even with withEnv, it does not recognize new variable.

            Unassigned Unassigned
            antoinetran Antoine Tran
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: