docker build, static golang builds

pull/523/head
hunterlong 2020-04-21 22:53:59 -07:00
parent bc3937a5dc
commit 1721715664
1 changed files with 9 additions and 8 deletions

View File

@ -1,12 +1,14 @@
FROM statping/statping:base AS base
# Statping main Docker image that contains all required libraries
FROM alpine:latest
RUN apk --no-cache add libgcc libstdc++ ca-certificates curl jq && update-ca-certificates
ARG VERSION
ARG ARCH
COPY --from=base /go/bin/statping /usr/local/bin/
COPY --from=base /usr/local/bin/sass /usr/local/bin/
COPY --from=base /usr/local/share/ca-certificates /usr/local/share/
RUN apk --no-cache add curl jq libsass linux-headers ca-certificates
RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \
chmod +x /usr/local/bin/sass
RUN curl -fsSL https://github.com/statping/statping/releases/download/v$VERSION/statping-linux-$ARCH.tar.gz -o statping.tar.gz && \
tar -C /usr/local/bin -xzf statping.tar.gz && rm statping.tar.gz
WORKDIR /app
@ -19,4 +21,3 @@ EXPOSE $PORT
HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true"
CMD statping --port $PORT