2019-06-20 19:58:51 +00:00
|
|
|
ARG REPO=library
|
|
|
|
FROM ${REPO}/python:3-alpine
|
2018-04-18 04:01:58 +00:00
|
|
|
LABEL maintainer="ian@iamthefij.com"
|
|
|
|
# Minitor: https://git.iamthefij.com/iamthefij/minitor
|
2018-03-16 21:20:03 +00:00
|
|
|
|
2019-06-20 19:58:51 +00:00
|
|
|
# This should be the target qemu arch
|
|
|
|
ARG ARCH=x86_64
|
|
|
|
COPY ./build/qemu-${ARCH}-static /usr/bin/
|
|
|
|
|
2019-08-01 20:59:05 +00:00
|
|
|
# Add common checking tools
|
2020-01-10 22:00:06 +00:00
|
|
|
RUN apk --no-cache add bash=~5.0 curl=~7.67 jq=~1.6
|
2018-03-16 21:20:03 +00:00
|
|
|
WORKDIR /app
|
2018-04-18 04:01:58 +00:00
|
|
|
|
2019-08-01 20:59:05 +00:00
|
|
|
# Add minitor user for running as non-root
|
|
|
|
RUN addgroup -S minitor && adduser -S minitor -G minitor
|
|
|
|
|
2018-07-13 06:01:36 +00:00
|
|
|
# Expose default metrics port
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2019-08-01 20:59:05 +00:00
|
|
|
# Copy default sample config
|
|
|
|
COPY ./sample-config.yml /app/config.yml
|
|
|
|
|
2018-10-29 19:28:17 +00:00
|
|
|
# Copy Python package to container
|
2018-04-18 04:01:58 +00:00
|
|
|
COPY ./README.md /app/
|
|
|
|
COPY ./setup.py /app/
|
|
|
|
COPY ./minitor /app/minitor
|
|
|
|
RUN pip install -e .
|
|
|
|
|
2018-10-29 19:28:17 +00:00
|
|
|
# Copy scripts
|
|
|
|
COPY ./scripts /app/scripts
|
|
|
|
|
2019-08-01 20:54:52 +00:00
|
|
|
# Allow all users to execute minitor and scripts
|
|
|
|
RUN chmod -R 755 /app
|
|
|
|
|
2019-08-01 20:59:05 +00:00
|
|
|
# Drop to non-root user
|
|
|
|
USER minitor
|
|
|
|
|
2018-07-13 06:01:36 +00:00
|
|
|
ENTRYPOINT [ "python3", "-m", "minitor.main" ]
|