Skip to content

Commit

Permalink
Fix golang vulnerabilities (#2351)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
pavannd1 and mergify[bot] authored Sep 21, 2023
1 parent 3ed70e0 commit 08d8926
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions docker/tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# Build Kopia binary
FROM golang:1.19-bullseye AS builder
FROM golang:1.21-bullseye AS builder

ARG kopia_build_commit=master
ARG kopia_repo_org=kopia
ENV CGO_ENABLED=1 GOEXPERIMENT=boringcrypto GO_EXTLINK_ENABLED=0
RUN apt-get install git

# Build restic binary from source - released version
# This will allow us to bring in security fixes without relying on the official
# image which is released once every quarter
WORKDIR /

RUN git clone https://github.com/restic/restic.git

ENV GITHUB_REPOSITORY=https://github.com/restic/restic

WORKDIR /restic

RUN git checkout v0.16.0
RUN go run build.go

# Build kopia binary from specific commit
WORKDIR /

RUN git clone https://github.com/${kopia_repo_org}/kopia.git
Expand All @@ -14,7 +29,6 @@ ENV GITHUB_REPOSITORY=https://github.com/${kopia_repo_org}/kopia

WORKDIR /kopia

# Build kopia binary from specific commit
RUN git checkout ${kopia_build_commit}
RUN GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o kopia \
-ldflags="-X github.com/kopia/kopia/repo.BuildVersion=$(git show --no-patch --format='%cs-%h') \
Expand Down Expand Up @@ -45,11 +59,11 @@ LABEL name="kanister-tools" \
vendor="Kanister" \
version="${kan_tools_version}" \
release="${kan_tools_version}" \
summary="Microservice for application-specific data management for Kubernetes" \
maintainer="Tom Manville<[email protected]>" \
description="Kanister tools for application-specific data management"
summary="Operator for data protection workflow management on Kubernetes" \
maintainer="Pavan N Devaraj<[email protected]>" \
description="Tools for application-specific data protection"

COPY --from=restic/restic:0.15.2 /usr/bin/restic /usr/local/bin/restic
COPY --from=builder /restic/restic /usr/local/bin/restic
COPY --from=builder /kopia/kopia /usr/local/bin/kopia
COPY LICENSE /licenses/LICENSE

Expand Down

0 comments on commit 08d8926

Please sign in to comment.