Skip to content

Commit

Permalink
feat: include buildx plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
steveiliop56 committed Mar 21, 2024
1 parent def0018 commit 04c32b1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ RUN apk add --no-cache tar wget
FROM builder_base as builder

ARG DOCKER_VERSION="25.0.5"
ARG BUILDX_VERSION="0.13.1"
ARG TARGETARCH
ENV DOCKER_VERSION=${DOCKER_VERSION}
ENV TARGETARCH=${TARGETARCH}
ENV BUILDX_VERSION=${BUILDX_VERSION}

RUN if [ "${TARGETARCH}" = "amd64" ]; then \
wget -O docker-bundle.tgz "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz"; \
Expand All @@ -25,6 +27,16 @@ RUN tar xzvf docker-bundle.tgz

RUN chmod +x docker/docker

RUN if [ "${TARGETARCH}" = "amd64" ]; then \
wget -O docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64"; \
elif [ "${TARGETARCH}" = "arm64" ]; then \
wget -O docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-arm64"; \
else \
echo "Unsupported architecture"; \
fi

RUN chmod +x docker-buildx

WORKDIR /app

COPY ./package.json ./
Expand All @@ -48,6 +60,7 @@ FROM node_base as app

WORKDIR /app

COPY --from=builder /docker-buildx /usr/lib/docker/cli-plugins/docker-buildx
COPY --from=builder /docker/docker /usr/bin/docker
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
Expand Down

0 comments on commit 04c32b1

Please sign in to comment.