2019-11-22 14:44:21 -08:00
|
|
|
ARG REPO=library
|
2020-01-10 14:21:48 -08:00
|
|
|
FROM multiarch/qemu-user-static:4.2.0-2 as qemu-user-static
|
2019-11-22 14:44:21 -08:00
|
|
|
FROM ${REPO}/alpine:3.10
|
2020-01-10 14:21:48 -08:00
|
|
|
|
|
|
|
# Copying all qemu files because amd64 doesn't exist and cannot condional copy
|
2020-01-30 11:35:59 -08:00
|
|
|
COPY --from=qemu-user-static /usr/bin/qemu-* /usr/bin/
|
2020-01-10 14:21:48 -08:00
|
|
|
|
2019-11-22 12:58:26 -08:00
|
|
|
RUN mkdir /app
|
|
|
|
WORKDIR /app/
|
2019-10-10 17:20:42 -07:00
|
|
|
|
2019-11-22 12:58:26 -08:00
|
|
|
# Add common checking tools
|
2019-11-22 14:44:21 -08:00
|
|
|
RUN apk --no-cache add bash=~5.0 curl=~7.66 jq=~1.6
|
2019-11-22 12:58:26 -08:00
|
|
|
|
|
|
|
# Add minitor user for running as non-root
|
|
|
|
RUN addgroup -S minitor && adduser -S minitor -G minitor
|
|
|
|
|
|
|
|
# Copy scripts
|
|
|
|
COPY ./scripts /app/scripts
|
|
|
|
RUN chmod -R 755 /app/scripts
|
|
|
|
|
2020-01-10 13:58:17 -08:00
|
|
|
# Copy minitor in
|
|
|
|
ARG ARCH=amd64
|
|
|
|
COPY ./minitor-linux-${ARCH} ./minitor
|
|
|
|
|
2019-11-22 12:58:26 -08:00
|
|
|
# Drop to non-root user
|
|
|
|
USER minitor
|
|
|
|
|
2019-10-10 17:20:42 -07:00
|
|
|
ENTRYPOINT [ "./minitor" ]
|