Skip to content

Commit

Permalink
Merge pull request #15 from furykerry/master
Browse files Browse the repository at this point in the history
fix docker build problem
  • Loading branch information
zmberg authored Jan 25, 2024
2 parents 18aab47 + c2b99c9 commit d756a0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ COPY go.sum go.sum
COPY main.go main.go
COPY internal/ internal/
COPY pkg/ pkg/
COPY vendor/ vendor/

# Build
RUN CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o kruise-state-metrics main.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -o kruise-state-metrics main.go

# Use Ubuntu 20.04 LTS as base image to package the binary
FROM ubuntu:focal
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile_multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ COPY go.sum go.sum
COPY main.go main.go
COPY internal/ internal/
COPY pkg/ pkg/
COPY vendor/ vendor/

# Build
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o kruise-state-metrics main.go
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -a -o kruise-state-metrics main.go

ARG BASE_IMAGE
ARG BASE_IMAGE_VERION
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERION}

RUN apk add --no-cache ca-certificates=~20220614-r4 bash=~5.2.15-r0 expat=~2.5.0-r0 \
RUN apk --no-cache add ca-certificates && update-ca-certificates \
&& rm -rf /var/cache/apk/*

WORKDIR /
Expand Down

0 comments on commit d756a0c

Please sign in to comment.