-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
37 lines (28 loc) · 858 Bytes
/
Dockerfile
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
31
32
33
34
35
36
37
# https://hub.docker.com/_/python/
FROM python:3.10-alpine
WORKDIR /opt/index-digest
# copy files required to run "pip install"
ADD setup.py README.md ./
ADD ./indexdigest/__init__.py ./indexdigest/__init__.py
# installs mysql_config and pip dependencies
# https://github.com/gliderlabs/docker-alpine/issues/181
RUN apk upgrade \
&& apk add --virtual build-deps gcc musl-dev \
&& apk add mariadb-dev \
&& pip install . \
&& rm -rf /root/.cache \
&& apk del build-deps
ARG GITHUB_SHA="dev"
ENV COMMIT_SHA ${GITHUB_SHA}
# install the remaining files
ADD . .
# run as nobody
ENV HOME /opt/index-digest
RUN chown -R nobody .
USER nobody
# install the entire package
RUN pip install --no-warn-script-location --user . \
&& rm -rf ~./cache
RUN index_digest --version
# docker run -t macbre/index-digest
ENTRYPOINT ["index_digest"]