mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
make buildx: make version in Dockerfile leading
This patch removes the `BUILDX_COMMIT` make variable. With the make variable removed, it no longer "masks" environment variables, and there is no longer a need to export the variable. A side effect of this change, is that (by default), the buildx image is tagged as `moby-buildx:latest`. This likely isn't a problem, because the build-cache would still be preserved in intermediate images. Having the image tagged as `:latest` also makes cleaning up easier (without having to remove the image for each version tagged. Otherwise, the behavior remains the same as before: # default rm -f bundles/buildx && make buildx # => => naming to docker.io/library/moby-buildx:latest github.com/docker/buildx v0.3.0 c967f1d # using a make variable: rm -f bundles/buildx && make BUILDX_COMMIT=v0.2.1 buildx # => => naming to docker.io/library/moby-buildx:v0.2.1 github.com/docker/buildx v0.2.1 0eb2df5 # using an environment variable: rm -f bundles/buildx && BUILDX_COMMIT=v0.2.2 make buildx # => => naming to docker.io/library/moby-buildx:v0.2.2 github.com/docker/buildx v0.2.2 ab5fe3d Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
365b3aee2d
commit
37fe68f5d6
2 changed files with 5 additions and 5 deletions
|
@ -1,9 +1,12 @@
|
|||
ARG GO_VERSION=1.12.10
|
||||
FROM golang:${GO_VERSION}-stretch
|
||||
ARG BUILDX_COMMIT=v0.3.0
|
||||
ARG BUILDX_REPO=https://github.com/docker/buildx.git
|
||||
|
||||
FROM golang:${GO_VERSION}-stretch
|
||||
ARG BUILDX_REPO
|
||||
RUN git clone "${BUILDX_REPO}" /buildx
|
||||
WORKDIR /buildx
|
||||
ARG BUILDX_COMMIT=master
|
||||
ARG BUILDX_COMMIT
|
||||
RUN git fetch origin "${BUILDX_COMMIT}":build && git checkout build
|
||||
RUN go mod download
|
||||
ARG GOOS
|
||||
|
|
3
Makefile
3
Makefile
|
@ -252,9 +252,6 @@ else
|
|||
buildx:
|
||||
endif
|
||||
|
||||
BUILDX_COMMIT ?= v0.3.0
|
||||
export BUILDX_COMMIT
|
||||
|
||||
bundles/buildx: BUILDX_DOCKERFILE ?= Dockerfile.buildx
|
||||
bundles/buildx: bundles ## build buildx CLI tool
|
||||
# This intetionally is not using the `--output` flag from the docker CLI which is a buildkit option
|
||||
|
|
Loading…
Add table
Reference in a new issue