forked from convox/convox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.buildkit
More file actions
46 lines (26 loc) · 1.12 KB
/
Dockerfile.buildkit
File metadata and controls
46 lines (26 loc) · 1.12 KB
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
44
45
46
FROM golang:1.24-alpine AS package
# Ensure all build tools (including ld) are present for ARM builds
RUN apk add --no-cache make binutils gcc musl-dev linux-headers libc-dev build-base
# Install binutils-gold to provide ld for ARM64 builds
RUN apk add --no-cache binutils-gold
WORKDIR /usr/src/convox
COPY . .
RUN make $GOPATH/bin/build
###########################################################################################
FROM moby/buildkit:v0.25.1-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.25.1 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" ]