forked from scaleway/scaleway-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (23 loc) · 766 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.23-alpine3.19 AS builder
ENV BUILD_IN_DOCKER true
ARG VERSION
# ca-certificates is needed to add the certificates on the next image
# since it's FROM scratch, it does not have any certificates
# bash is needed to run the build script
RUN apk update && apk add --no-cache bash git
WORKDIR /go/src/github.com/scaleway/scaleway-cli
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY scripts/ scripts/
COPY cmd/ cmd/
COPY core/ core/
COPY commands/ commands/
COPY internal/ internal/
COPY .git/ .git/
RUN ./scripts/build.sh
FROM alpine:3.21
WORKDIR /
RUN apk update && apk add --no-cache bash ca-certificates openssh-client && update-ca-certificates
COPY --from=builder /go/src/github.com/scaleway/scaleway-cli/scw .
ENTRYPOINT ["/scw"]