diff --git a/Dockerfile b/Dockerfile index e944c0b84..4a05932fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG BASE_IMAGE="alpine:latest" +ARG BASE_IMAGE # Build the manager binary -FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder +FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder WORKDIR /workspace # Copy the Go Modules manifests @@ -34,9 +34,9 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ # You can replace distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details # Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot` -FROM ${BASE_IMAGE:-alpine:latest} +FROM ${BASE_IMAGE:-alpine:3.15} # This is required by daemon connnecting with cri -RUN apk add --no-cache ca-certificates bash +RUN apk add --no-cache ca-certificates bash expat WORKDIR / diff --git a/Dockerfile.apiserver b/Dockerfile.apiserver index 4b39b7130..f9544b087 100644 --- a/Dockerfile.apiserver +++ b/Dockerfile.apiserver @@ -1,6 +1,6 @@ -ARG BASE_IMAGE="alpine:latest" +ARG BASE_IMAGE # Build the manager binary -FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder +FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder ARG GOPROXY ENV GOPROXY=${GOPROXY:-https://goproxy.cn} WORKDIR /workspace @@ -32,9 +32,9 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ # Refer to https://github.com/GoogleContainerTools/distroless for more details # Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot` -FROM ${BASE_IMAGE:-alpine:latest} +FROM ${BASE_IMAGE:-alpine:3.15} # This is required by daemon connnecting with cri -RUN apk add --no-cache ca-certificates bash +RUN apk add --no-cache ca-certificates bash expat WORKDIR / diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 2d532b729..5b8893767 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -1,5 +1,6 @@ +ARG BASE_IMAGE # Build the manager binary -FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder +FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder WORKDIR /workspace # Copy the Go Modules manifests @@ -24,8 +25,8 @@ ARG VERSION ARG GITVERSION RUN apk add gcc musl-dev libc-dev ;\ - GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ - go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... . + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ + go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... . RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \ @@ -35,10 +36,10 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ # You can replace distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details # Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot` -ARG BASE_IMAGE -FROM ${BASE_IMAGE:-alpine:latest} + +FROM ${BASE_IMAGE:-alpine:3.15} # This is required by daemon connnecting with cri -RUN apk add --no-cache ca-certificates bash +RUN apk add --no-cache ca-certificates bash expat WORKDIR /