-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 795 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 795 Bytes
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
# Copyright (c) Curt Bushko.
# SPDX-License-Identifier: MPL-2.0
ARG GOVERSION=1.18
FROM golang:${GOVERSION} AS builder
MAINTAINER Curt Bushko (https://github.com/curtbushko)
LABEL org.opencontainers.image.source=https://github.com/curtbushko/commit-status-action
ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
RUN apt-get -qq update && apt-get -yqq install upx file
WORKDIR /src
COPY . .
RUN mkdir -p /bin && go build -o /bin/action .
RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_passwd
FROM scratch
MAINTAINER Curt Bushko (https://github.com/curtbushko)
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc_passwd /etc/passwd
COPY --from=builder --chown=65534:0 /bin/action /action
USER nobody
ENTRYPOINT ["/action"]