forked from digitalocean/doctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 656 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) · 656 Bytes
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
31
32
33
34
35
36
# Step 1: Build
FROM golang:1.24-alpine AS build
ARG GOARCH=amd64
ENV OUT_D /out
RUN mkdir -p /out
RUN apk add --update --no-cache \
bash \
coreutils \
git \
libc6-compat \
make
RUN mkdir -p /go/src/github.com/digitalocean/doctl
ADD . /go/src/github.com/digitalocean/doctl/
RUN cd /go/src/github.com/digitalocean/doctl && \
make build GOARCH=$GOARCH
# Step 2: App
FROM alpine:3.12
RUN apk add --update --no-cache \
ca-certificates \
libc6-compat \
openssh
WORKDIR /app
ENV PATH="/app:$PATH"
COPY --from=build /out/doctl /app/doctl
RUN adduser -D user
USER user:user
ENTRYPOINT ["/app/doctl"]