forked from panther-labs/panther-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (43 loc) · 1.38 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
43
44
45
46
47
48
49
50
51
FROM --platform=$TARGETPLATFORM cgr.dev/chainguard/wolfi-base
ARG TARGETPLATFORM
ARG PYTHON_VERSION="3.9.18"
RUN apk update \
&& apk add --no-cache \
bash \
build-base \
bzip2-dev \
git \
libffi-dev \
openssl-dev \
readline-dev \
sqlite-dev \
tk-dev \
wget \
xz-dev \
zlib \
zlib-dev
# Install pyenv
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv \
&& cd ~/.pyenv && src/configure && make -C src \
&& for path in "$HOME/.bash_profile" "$HOME/.bashrc" "$HOME/.profile"; do \
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> "$path"; \
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> "$path"; \
echo 'eval "$(pyenv init -)"' >> "$path"; \
done
ENV PATH="/root/.pyenv/bin:$PATH"
ENV PATH="/root/.pyenv/shims:$PATH"
# Install Python
RUN env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native' pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION
# Install pipenv
RUN pip install --upgrade pip
RUN pip install pipenv
WORKDIR /home/panther-analysis
# Install requirements
COPY Pipfile .
COPY Pipfile.lock .
RUN pipenv uninstall --all
RUN pipenv sync --dev
# Remove pipfile so it doesn't interfere with local files after install
RUN rm Pipfile
RUN rm Pipfile.lock