github.com/kubevela/workflow@v0.6.0/Dockerfile.e2e (about)

     1  ARG BASE_IMAGE
     2  # Build the manager binary
     3  FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
     4  ARG GOPROXY
     5  ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
     6  WORKDIR /workspace
     7  # Copy the Go Modules manifests
     8  COPY go.mod go.mod
     9  COPY go.sum go.sum
    10  # cache deps before building and copying source so that we don't need to re-download as much
    11  # and so that source changes don't invalidate our downloaded layer
    12  RUN go mod download
    13  
    14  # Copy the go source
    15  COPY cmd/main.go main.go
    16  COPY cmd/main_e2e_test.go main_e2e_test.go
    17  COPY api/ api/
    18  COPY controllers/ controllers/
    19  COPY pkg/ pkg/
    20  COPY version/ version/
    21  
    22  # Build
    23  ARG TARGETARCH
    24  
    25  RUN  apk add gcc musl-dev libc-dev ;\
    26      GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
    27      go test -c -o vela-workflow-${TARGETARCH}  -cover -covermode=atomic -coverpkg ./... .
    28  
    29  FROM ${BASE_IMAGE:-alpine:3.15}
    30  # This is required by daemon connecting with cri
    31  RUN apk add --no-cache ca-certificates bash expat
    32  
    33  WORKDIR /
    34  
    35  ARG TARGETARCH
    36  COPY --from=builder /workspace/vela-workflow-${TARGETARCH} /usr/local/bin/vela-workflow
    37  
    38  VOLUME ["/workspace/data"]
    39  ENTRYPOINT ["vela-workflow"]