Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Fix docker build in capabilities and features packages #765

Merged
merged 1 commit into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions pkg/v1/sdk/capabilities/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ RUN go mod download
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer


# Copy the go source
COPY apis/ apis/
COPY pkg/v1/sdk/ pkg/v1/sdk/
COPY cmd/managers/capabilities/main.go main.go

COPY ./ ./

# Build
ARG LD_FLAGS
ENV LD_FLAGS="$LD_FLAGS "'-extldflags "-static"'
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -ldflags "$LD_FLAGS" -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -ldflags "$LD_FLAGS" -o manager ./cmd/managers/capabilities/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
8 changes: 2 additions & 6 deletions pkg/v1/sdk/features/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ RUN go mod download
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer


# Copy the go source
COPY apis/ apis/
COPY pkg/v1/sdk/ pkg/v1/sdk/
COPY cmd/managers/featuregate/main.go main.go

COPY ./ ./

# Build
ARG LD_FLAGS
ENV LD_FLAGS="$LD_FLAGS "'-extldflags "-static"'
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -ldflags "$LD_FLAGS" -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -ldflags "$LD_FLAGS" -o manager ./cmd/managers/featuregate/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down