Skip to content
Snippets Groups Projects
Commit c88cfb69 authored by Griefed's avatar Griefed :joystick:
Browse files

build: Always fetch latest version of buildx. Ensure file permissions after copying from fetcher.

parent fbcafa9c
No related branches found
No related tags found
No related merge requests found
ARG BUILDX_VERSION=0.4.2
ARG DOCKER_VERSION=latest
FROM alpine AS fetcher
RUN apk add curl
ARG BUILDX_VERSION
RUN curl -L \
--output /docker-buildx \
"https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64"
RUN \
apk add \
curl && \
LATEST_DOCKERX=$(curl --silent "https://api.github.com/repos/docker/buildx/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 2-) && \
curl \
-L \
--output /docker-buildx \
"https://github.com/docker/buildx/releases/download/v${LATEST_DOCKERX}/buildx-v${LATEST_DOCKERX}.linux-amd64" && \
chmod a+x \
/docker-buildx
RUN chmod a+x /docker-buildx
FROM docker:latest
ARG DOCKER_VERSION
FROM docker:${DOCKER_VERSION}
LABEL maintainer="Griefed <griefed@griefed.de>"
COPY --from=fetcher /docker-buildx /usr/lib/docker/cli-plugins/docker-buildx
RUN chmod a+x /usr/lib/docker/cli-plugins/docker-buildx
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment