-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (30 loc) · 1.46 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM golang:1.23.5-alpine@sha256:47d337594bd9e667d35514b241569f95fb6d95727c24b19468813d596d5ae596 AS runner-compilation
ARG ARCH
ARG RUNNER_VERSION
ENV GOPATH=""
ENV CGO_ENABLED=0
RUN apk add --no-cache git && \
git clone https://github.com/drone-runners/drone-runner-docker -b "${RUNNER_VERSION}" && \
cd drone-runner-docker && \
GOOS=linux GOARCH=${ARCH} go build -o release/linux/${ARCH}/drone-runner-docker
FROM alpine:3.21.2@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 AS tmate-installation
ARG ARCH
ARG ARCH_AUX
ARG VARIANT
ARG TMATE_VERSION
RUN apk add -U --no-cache ca-certificates wget && \
wget https://github.com/tmate-io/tmate/releases/download/${TMATE_VERSION}/tmate-${TMATE_VERSION}-static-linux-"${ARCH}""${ARCH_AUX:-}""${VARIANT:-}".tar.xz && \
tar -xf tmate-${TMATE_VERSION}-static-linux-"${ARCH}""${ARCH_AUX:-}""${VARIANT:-}".tar.xz && \
mv tmate-${TMATE_VERSION}-static-linux-"${ARCH}""${ARCH_AUX:-}""${VARIANT:-}"/tmate /bin/ && \
chmod +x /bin/tmate
FROM scratch
ARG ARCH
EXPOSE 3000
ENV GODEBUG=netdns=go
ENV DRONE_PLATFORM_OS=linux
ENV DRONE_PLATFORM_ARCH=${ARCH}
COPY --from=tmate-installation /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=tmate-installation /bin/tmate /bin/
LABEL com.centurylinklabs.watchtower.stop-signal="SIGINT"
COPY --from=runner-compilation /go/drone-runner-docker/release/linux/${ARCH}/drone-runner-docker /bin/
ENTRYPOINT ["/bin/drone-runner-docker"]