Skip to content

Commit

Permalink
add docker and buildx to the builder image
Browse files Browse the repository at this point in the history
  • Loading branch information
rajrohanyadav committed Dec 5, 2024
1 parent 16317e9 commit 790b999
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM ubuntu:${UBUNTU_VERSION}
ARG GO_VERSION=1.23.2
ARG ARCH='amd64'
ARG GH_VERSION='2.61.0'
ARG DOCKER_VERSION='24.0.5'
ARG BUILDX_VERSION='0.11.2'

# Install dependencies
RUN apt-get update && apt-get install -y \
Expand Down Expand Up @@ -44,6 +46,16 @@ ENV GOPATH="/go"
# https://github.com/kubernetes-sigs/gateway-api/pull/2302#issuecomment-1855818388
ENV GOFLAGS="-buildvcs=false"

# Install Docker
RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -o docker.tgz && \
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz

# Install Buildx
RUN mkdir -p ~/.docker/cli-plugins && \
curl -sSL https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-${ARCH} -o ~/.docker/cli-plugins/docker-buildx && \
chmod +x ~/.docker/cli-plugins/docker-buildx

# Since the user does not match the owners of the repo "git rev-parse --is-inside-work-tree" fails and goreleaser does not populate projectName
# https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-repositor
RUN git config --global --add safe.directory '*'
Expand Down

0 comments on commit 790b999

Please sign in to comment.