-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (39 loc) · 1.72 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (39 loc) · 1.72 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
47
48
49
50
51
52
53
54
55
56
57
58
# FIXME: https://github.com/palantir/policy-bot/issues/558
# https://github.com/palantir/policy-bot/blob/develop/.palantir/go-version
FROM golang:1.23.4-alpine3.19@sha256:5f3336882ad15d10ac1b59fbaba7cb84c35d4623774198b36ae60edeba45fd84 AS build
WORKDIR /src
# hadolint ignore=DL3018
RUN apk add --no-cache bash git nodejs npm yarn curl wget
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
ENV CGO_ENABLED=0
# renovate: datasource=github-releases depName=palantir/policy-bot
ARG POLICY_BOT_VERSION=v1.36.4
RUN git clone --depth 1 -c advice.detachedHead=false \
--branch "$POLICY_BOT_VERSION" https://github.com/palantir/policy-bot.git .
# https://github.com/palantir/policy-bot/blob/develop/.github/workflows/build.yml
# Install frontend dependencies
# hadolint ignore=DL3059
RUN yarn install
# Build frontend
# hadolint ignore=DL3059
RUN yarn run build:production
# Build distribution
# hadolint ignore=DL3059
RUN ./godelw dist
# https://hub.docker.com/r/palantirtechnologies/policy-bot
# https://github.com/palantir/policy-bot/blob/develop/docker/Dockerfile
FROM alpine:3.24@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
WORKDIR /policy-bot
COPY --from=build /src/build/policy-bot/*/bin/policy-bot-*.tgz ./policy-bot.tgz
# add the default configuration file
COPY --from=build /src/config/policy-bot.example.yml /secrets/policy-bot.yml
ARG TARGETARCH
RUN tar -zxvf policy-bot.tgz --strip-components=1 && \
ln -s "$(pwd)/bin/linux-${TARGETARCH}/policy-bot" "$(pwd)/bin/policy-bot" && \
rm policy-bot.tgz
COPY src/docker/ca-certificates.crt /etc/ssl/certs/
COPY src/docker/mime.types /etc/
RUN bin/policy-bot --help
ENTRYPOINT [ "bin/policy-bot" ]
CMD [ "server", "--config", "/secrets/policy-bot.yml" ]
STOPSIGNAL SIGINT