set PRODUCT_VERSION for docker build (#14242)
Changes proposed in this PR:
In `actions-docker-build` we [pass](05c370a26e/scripts/docker_build (L49)
) `PRODUCT_VERSION` to the docker build command. Since this was not set, the label did not populate properly which is used in a comparison to determine the `minor-latest` and `latest` docker image tags.
How I've tested this PR:
- build the image up to the point of label creation and pass in `--build-arg PRODUCT_VERSION=1.2.3`
- inspect the image for the label with the above command
How I expect reviewers to test this PR:
- same as above
Related [internal-only] post about this: https://hashicorp.atlassian.net/wiki/spaces/RELENG/pages/2416934922/August+17+2022-+Docker+Build+Failures
This commit is contained in:
parent
a5a200e0e9
commit
bc6ee86d29
10
Dockerfile
10
Dockerfile
|
@ -110,13 +110,13 @@ CMD ["agent", "-dev", "-client", "0.0.0.0"]
|
||||||
# Remember, this image cannot be built locally.
|
# Remember, this image cannot be built locally.
|
||||||
FROM docker.mirror.hashicorp.services/alpine:3.15 as default
|
FROM docker.mirror.hashicorp.services/alpine:3.15 as default
|
||||||
|
|
||||||
ARG VERSION
|
ARG PRODUCT_VERSION
|
||||||
ARG BIN_NAME
|
ARG BIN_NAME
|
||||||
|
|
||||||
# PRODUCT_NAME and PRODUCT_VERSION are the name of the software on releases.hashicorp.com
|
# PRODUCT_NAME and PRODUCT_VERSION are the name of the software on releases.hashicorp.com
|
||||||
# and the version to download. Example: PRODUCT_NAME=consul PRODUCT_VERSION=1.2.3.
|
# and the version to download. Example: PRODUCT_NAME=consul PRODUCT_VERSION=1.2.3.
|
||||||
ENV BIN_NAME=$BIN_NAME
|
ENV BIN_NAME=$BIN_NAME
|
||||||
ENV VERSION=$VERSION
|
ENV VERSION=$PRODUCT_VERSION
|
||||||
|
|
||||||
ARG PRODUCT_REVISION
|
ARG PRODUCT_REVISION
|
||||||
ARG PRODUCT_NAME=$BIN_NAME
|
ARG PRODUCT_NAME=$BIN_NAME
|
||||||
|
@ -128,7 +128,7 @@ LABEL org.opencontainers.image.authors="Consul Team <consul@hashicorp.com>" \
|
||||||
org.opencontainers.image.url="https://www.consul.io/" \
|
org.opencontainers.image.url="https://www.consul.io/" \
|
||||||
org.opencontainers.image.documentation="https://www.consul.io/docs" \
|
org.opencontainers.image.documentation="https://www.consul.io/docs" \
|
||||||
org.opencontainers.image.source="https://github.com/hashicorp/consul" \
|
org.opencontainers.image.source="https://github.com/hashicorp/consul" \
|
||||||
org.opencontainers.image.version=$VERSION \
|
org.opencontainers.image.version=${PRODUCT_VERSION} \
|
||||||
org.opencontainers.image.vendor="HashiCorp" \
|
org.opencontainers.image.vendor="HashiCorp" \
|
||||||
org.opencontainers.image.title="consul" \
|
org.opencontainers.image.title="consul" \
|
||||||
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration."
|
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration."
|
||||||
|
@ -217,7 +217,7 @@ LABEL org.opencontainers.image.authors="Consul Team <consul@hashicorp.com>" \
|
||||||
org.opencontainers.image.url="https://www.consul.io/" \
|
org.opencontainers.image.url="https://www.consul.io/" \
|
||||||
org.opencontainers.image.documentation="https://www.consul.io/docs" \
|
org.opencontainers.image.documentation="https://www.consul.io/docs" \
|
||||||
org.opencontainers.image.source="https://github.com/hashicorp/consul" \
|
org.opencontainers.image.source="https://github.com/hashicorp/consul" \
|
||||||
org.opencontainers.image.version=$VERSION \
|
org.opencontainers.image.version=${PRODUCT_VERSION} \
|
||||||
org.opencontainers.image.vendor="HashiCorp" \
|
org.opencontainers.image.vendor="HashiCorp" \
|
||||||
org.opencontainers.image.title="consul" \
|
org.opencontainers.image.title="consul" \
|
||||||
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration."
|
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration."
|
||||||
|
@ -284,4 +284,4 @@ USER 100
|
||||||
# By default you'll get an insecure single-node development server that stores
|
# By default you'll get an insecure single-node development server that stores
|
||||||
# everything in RAM, exposes a web UI and HTTP endpoints, and bootstraps itself.
|
# everything in RAM, exposes a web UI and HTTP endpoints, and bootstraps itself.
|
||||||
# Don't use this configuration for production.
|
# Don't use this configuration for production.
|
||||||
CMD ["agent", "-dev", "-client", "0.0.0.0"]
|
CMD ["agent", "-dev", "-client", "0.0.0.0"]
|
||||||
|
|
Loading…
Reference in New Issue