forked from convox/convox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.buildkit
43 lines (23 loc) · 960 Bytes
/
Dockerfile.buildkit
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
37
38
39
40
41
42
43
FROM golang:1.18-alpine AS package
RUN apk update && apk add make gcc linux-headers libc-dev
WORKDIR /usr/src/convox
COPY . .
RUN make $GOPATH/bin/build
###########################################################################################
FROM moby/buildkit:v0.12.4-rootless as rootless
USER root
RUN apk add skopeo --update
COPY --from=package /go/bin/build /usr/bin
COPY ./scripts/buildctl-daemonless.sh /buildctl-daemonless.sh
USER 1000
# standard credentials path used by buildkit
RUN mkdir -p $HOME/.docker
ENTRYPOINT [ "./buildctl-daemonless.sh" ]
###########################################################################################
FROM moby/buildkit:v0.12.4 as privileged
RUN apk add skopeo --update
COPY --from=package /go/bin/build /usr/bin
COPY ./scripts/buildctl-daemonless.sh /buildctl-daemonless.sh
# standard credentials path used by buildkit
RUN mkdir -p $HOME/.docker
ENTRYPOINT [ "./buildctl-daemonless.sh" ]