-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
42 lines (35 loc) · 1.13 KB
/
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
38
39
40
41
42
FROM python:3.8.0-slim-buster
# So that STDOUT/STDERR is printed
ENV PYTHONUNBUFFERED="1"
# We create the default user and group to run unprivileged
ENV HUNTER_HOME /srv/hunter
WORKDIR ${HUNTER_HOME}
RUN groupadd --gid 8192 hunter && \
useradd --uid 8192 --shell /bin/false --create-home --no-log-init --gid hunter hunter && \
chown hunter:hunter ${HUNTER_HOME}
# First let's just get things updated.
# Install System dependencies
RUN apt-get update --assume-yes && \
apt-get install -o 'Dpkg::Options::=--force-confnew' -y --force-yes -q \
git \
openssh-client \
gcc \
clang \
build-essential \
make \
curl \
virtualenv \
&& rm -rf /var/lib/apt/lists/*
# Get poetry package
RUN curl -sSL https://install.python-poetry.org | python3 -
# Adding poetry to PATH
ENV PATH="/root/.local/bin/:$PATH"
# Copy the rest of the program over
COPY --chown=hunter:hunter . ${HUNTER_HOME}
ENV PATH="${HUNTER_HOME}/bin:$PATH"
RUN --mount=type=ssh \
virtualenv --python python3.8 venv && \
. venv/bin/activate && \
poetry install -v && \
mkdir -p bin && \
ln -s ../venv/bin/hunter ${HUNTER_HOME}/bin