github.com/opentofu/opentofu@v1.7.1/.github/workflows/build-Dockerfile (about)

     1  # This Dockerfile is not intended for general use, but is rather used to
     2  # produce our "light" release packages as part of our official release
     3  # pipeline.
     4  #
     5  # If you want to test this locally you'll need to set the three arguments
     6  # to values realistic for what the hashicorp/actions-docker-build GitHub
     7  # action would set, and ensure that there's a suitable "tofu" executable
     8  # in the dist/linux/${TARGETARCH} directory.
     9  
    10  FROM docker.io/alpine:latest AS default
    11  
    12  # This is intended to be run from the hashicorp/actions-docker-build GitHub
    13  # action, which sets these appropriately based on context.
    14  ARG PRODUCT_VERSION=UNSPECIFIED
    15  ARG PRODUCT_REVISION=UNSPECIFIED
    16  ARG BIN_NAME=tofu
    17  
    18  # This argument is set by the Docker toolchain itself, to the name
    19  # of the CPU architecture we're building an image for.
    20  # Our caller should've extracted the corresponding "tofu" executable
    21  # into dist/linux/${TARGETARCH} for us to use.
    22  ARG TARGETARCH
    23  
    24  LABEL maintainer="OpenTofu Team"
    25  
    26  # New standard version label.
    27  LABEL version=$PRODUCT_VERSION
    28  
    29  # Historical OpenTofu-specific label preserved for backward compatibility.
    30  LABEL "com.tofu.version"="${PRODUCT_VERSION}"
    31  
    32  RUN apk add --no-cache git openssh
    33  
    34  # The hashicorp/actions-docker-build GitHub Action extracts the appropriate
    35  # release package for our target architecture into the current working
    36  # directory before running "docker build", which we'll then copy into the
    37  # Docker image to make sure that we use an identical binary as all of the
    38  # other official release channels.
    39  COPY ["dist/linux/${TARGETARCH}/tofu", "/bin/tofu"]
    40  
    41  ENTRYPOINT ["/bin/tofu"]