Skip to content

Packer's docker plugin metadata change for Env does require equal sign and cannot extend env vars in hcl2 variant language #155

@TamasSzerb

Description

@TamasSzerb
source "docker" "ubi9-minimal" {
  image  = "proxy-registry.example.com/library/external/registry.access.redhat.com/ubi9-minimal:latest"
  commit = true
  # https://developer.hashicorp.com/packer/plugins/builders/docker#basic-example-changes-to-metadata
  changes = [
    "ENV MOO=foo",
    "ENV PATH=${local.JDK_DIR}:$PATH"
  ]
}

hcl2

  1. Contrary to the documentation Packer v1.8.6 requires the "=" sign to alter the environment variables
  2. Cannot extend (inherit and add) existing env vars like PATH

Please fix the doc and add that feature if I am correct.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions