services/templates/woodpecker/Dockerfile.gotmpl

29 lines
1.1 KiB
Docker
Raw Normal View History

# syntax=docker/dockerfile:1
FROM alpine:3.17
WORKDIR /tmp
RUN --mount=type=bind,source=.,target=/packages \
apk update --no-cache && apk add --no-cache \
bash \
ca-certificates \
&& addgroup -g {{ .FlowGID }} flow \
&& adduser -S -H -D -s /bin/bash -u {{ .Woodpecker.LinuxUID }} -G flow workflow \
&& mkdir -p {{ .Woodpecker.DataContainerDirectory }} \
&& chown {{ .Woodpecker.LinuxUID }}:{{ .Woodpecker.LinuxUID }} {{ .Woodpecker.DataContainerDirectory }} \
&& chmod 0700 {{ .Woodpecker.DataContainerDirectory }} \
&& tar xzvf /packages/woodpecker-server-{{ .Woodpecker.Version }}_linux_amd64.tar.gz \
&& mv /tmp/woodpecker-server /usr/local/bin/woodpecker-server \
&& rm -rf /tmp/*
COPY --chown={{ .Woodpecker.LinuxUID }}:{{ .Woodpecker.LinuxUID }} entrypoint.sh /usr/local/bin/entrypoint
COPY --chown={{ .Woodpecker.LinuxUID }}:{{ .FlowGID }} traefik_woodpecker.yaml /flow/woodpecker/tmp/traefik_woodpecker.yaml
RUN chmod a+x /usr/local/bin/entrypoint
ENV GODEBUG=netdns=go
USER {{ .Woodpecker.LinuxUID }}:{{ .FlowGID }}
ENTRYPOINT ["entrypoint"]