Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • images images
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • imagesimages
  • Merge requests
  • !229

Replace ENV with ARG instruction in Dockerfiles

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Michal Nowak requested to merge mnowak/dockerfile-replace-ENV-with-ARG-instruction into main Mar 20, 2023
  • Overview 2
  • Commits 1
  • Pipelines 2
  • Changes 8

The ENV instruction has, for the most part, unexpected side effects: "The environment variables set using ENV will persist when a container is run from the resulting image." This is rarely needed and may cause problems in the BIND 9 CI. ARG instruction does not have this side effect and perishes with the build environment.

I checked the BIND 9 repository, and no former ENV variable is required there.

BIND 9 validation run with staging images: https://gitlab.isc.org/isc-projects/bind9/-/pipelines/132178

Alpine Linux 3.17 container:

Before:

/ # env
HOSTNAME=8192f20fcc2b
SHLVL=1
HOME=/root
KYUA_GIT_COMMIT=2fc3c21c30f9c52efaacb73f6f8b8dc716cf4bc2
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
JEMALLOC_VERSION=5.3.0
PWD=/

After (KYUA_GIT_COMMIT and JEMALLOC_VERSION are not present anymore):

HOSTNAME=a2f72333fc40
SHLVL=1
HOME=/root
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
Edited Mar 20, 2023 by Michal Nowak
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: mnowak/dockerfile-replace-ENV-with-ARG-instruction