-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (32 loc) · 1.03 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
FROM golang:1.15 AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
ENV CGO_ENABLED=0
COPY . .
WORKDIR entrypoint
RUN go build -ldflags="-s -w"
WORKDIR ../mux
RUN go build -ldflags="-s -w"
WORKDIR ../worker
RUN go build -ldflags="-s -w"
# using 1.13 because of SIGURG issues. TODO investigate why
FROM golang:1.13 AS preload
WORKDIR /preload
COPY . .
RUN go build -buildmode=c-shared -o preload.so -ldflags="-s -w" ./preload
FROM ubuntu AS base
RUN apt-get update && apt-get install -y curl git libicu60
WORKDIR /runner
RUN curl -o runner.tgz -L https://github.com/actions/runner/releases/download/v2.273.5/actions-runner-linux-x64-2.273.5.tar.gz && \
tar xvf runner.tgz && \
rm runner.tgz
RUN mkdir -p _diag _work && chmod 0777 _diag _work
FROM base AS listener
COPY --from=preload /preload/preload.so /runner/preload.so
COPY --from=builder /build//worker/worker /runner/bin/Runner.Worker
COPY --from=builder /build/mux/mux /usr/bin
CMD mux
FROM base AS worker
COPY --from=builder /build/entrypoint /usr/bin
CMD entrypoint