replaced .travis.yml with multistage Docker build

This commit is contained in:
Mahmoud Rahbar Azad 2018-10-25 22:32:22 +02:00
parent ddb4f49cf7
commit 2619e02988
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 7DBBD39E2BFEB784
3 changed files with 24 additions and 27 deletions

20
Dockerfile Normal file
View file

@ -0,0 +1,20 @@
FROM golang:alpine as builder
RUN apk update && apk add git && apk add ca-certificates
RUN adduser -D -g '' appuser
RUN mkdir /hetzner-sb-notifier
COPY . /hetzner-sb-notifier/
WORKDIR /hetzner-sb-notifier
ENV VERSION=1.0
RUN chmod +x build.sh
RUN /hetzner-sb-notifier/build.sh linux
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /hetzner-sb-notifier/build/hetzner-sb-notifier_linux_amd64 /hetzner-sb-notifier
RUN chmod +x hetzner-sb-notifier
USER appuser
ENTRYPOINT ["/hetzner-sb-notifier"]