Skip to content

Commit dee3f71

Browse files
Dominik FalknerDominik Falkner
authored andcommitted
2 parents 1cf1882 + 2319522 commit dee3f71

3 files changed

Lines changed: 29 additions & 23 deletions

File tree

‎{{ cookiecutter.__package_name_kebab_case }}/Dockerfile-base‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# This dockerfile serves as a base for all testing images.
22
# It contains the minimal dependencies and is therefore smaller.
33
from debian:stable-slim
4-
ARG PYTHON_VERSION={{cookiecutter.python_version}}
5-
ARG POETRY_VERSION=1.7.1
64

5+
ARG PYTHON_VERSION={{cookiecutter.python_version}}
6+
ARG POETRY_VERSION=1.8.0
77
ENV DEBIAN_FRONTEND noninteractive
8+
89
LABEL maintainer="{{cookiecutter.author_name}} <{{cookiecutter.author_email}}>"
910

10-
RUN apt-get update && apt-get install -yq \
11+
RUN apt-get update && apt-get install -yq \
1112
build-essential \
1213
libssl-dev \
1314
zlib1g-dev \
1415
libbz2-dev \
1516
libreadline-dev \
1617
libsqlite3-dev \
17-
curl \
18+
curl \
1819
libncursesw5-dev \
1920
xz-utils \
2021
tk-dev \
@@ -33,12 +34,9 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
3334
RUN set -ex \
3435
&& curl https://pyenv.run | bash \
3536
&& pyenv update \
36-
&& eval "$(pyenv init -)" \
37-
# activate pyenv on shell start
38-
&& pyenv init - > ~/.bashrc
39-
40-
# Install python and set interpreter
41-
RUN pyenv install -s ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION}
37+
&& pyenv install -s ${PYTHON_VERSION} \
38+
&& pyenv global ${PYTHON_VERSION} \
39+
&& pyenv rehash
4240

4341
# Install and configure Poetry
4442
ENV POETRY_VERSION=${POETRY_VERSION} \
@@ -51,9 +49,15 @@ ENV PATH="${PATH}:${POETRY_HOME}/bin"
5149
RUN mkdir /repo
5250
WORKDIR /repo
5351

52+
# set python path to default
53+
ENV PYTHONPATH "${PYTHONPATH}:/repo"
54+
5455
# Install dependencies (package itself is not installed)
5556
COPY pyproject.toml poetry.lock .
5657
RUN poetry install --without dev --all-extras --no-root
5758

59+
# update any paths of installed cli tools (from pip)
60+
RUN pyenv rehash
61+
5862
# Copy the rest of the repository
5963
ADD . .

‎{{ cookiecutter.__package_name_kebab_case }}/Dockerfile-cuda‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# This dockerfile serves as a base for all testing images.
22
# It contains the minimal dependencies and is therefore smaller.
33
from nvidia/cuda:12.3.1-runtime-ubuntu22.04
4-
ARG PYTHON_VERSION=3.10
5-
ARG POETRY_VERSION=1.7.1
64

5+
ARG PYTHON_VERSION={{cookiecutter.python_version}}
6+
ARG POETRY_VERSION=1.8.0
77
ENV DEBIAN_FRONTEND noninteractive
8-
LABEL maintainer="Dominik Falkner <dominik.falkner@risc-software.at>"
8+
9+
LABEL maintainer="{{cookiecutter.author_name}} <{{cookiecutter.author_email}}>"
910

1011
RUN apt-get update --allow-insecure-repositories && apt-get install -yq \
1112
build-essential \
@@ -37,12 +38,9 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
3738
RUN set -ex \
3839
&& curl https://pyenv.run | bash \
3940
&& pyenv update \
40-
&& eval "$(pyenv init -)" \
41-
# activate pyenv on shell start
42-
&& pyenv init - > ~/.bashrc
43-
44-
# Install python and set interpreter
45-
RUN pyenv install -s ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION}
41+
&& pyenv install -s ${PYTHON_VERSION} \
42+
&& pyenv global ${PYTHON_VERSION} \
43+
&& pyenv rehash
4644

4745
# Install and configure Poetry
4846
ENV POETRY_VERSION=${POETRY_VERSION} \
@@ -54,6 +52,7 @@ ENV PATH="${PATH}:${POETRY_HOME}/bin"
5452
# Setup directory structure
5553
RUN mkdir /repo
5654
WORKDIR /repo
55+
5756
# set pythonpath for nvidia image
5857
ENV PYTHONPATH "${PYTHONPATH}:/repo"
5958

@@ -64,4 +63,6 @@ RUN poetry install --all-extras --no-root
6463
# Copy the rest of the repository
6564
ADD . .
6665

67-
ENTRYPOINT ["tail", "-f", "/dev/null"]
66+
# special entry point which allows you to start the container manually, will keep the container alive
67+
# ENTRYPOINT ["tail", "-f", "/dev/null"]
68+

‎{{ cookiecutter.__package_name_kebab_case }}/Dockerfile-test‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ ARG POETRY_VERSION=1.7.1
77
ENV DEBIAN_FRONTEND noninteractive
88
LABEL maintainer="{{cookiecutter.author_name}} <{{cookiecutter.author_email}}>"
99

10-
RUN apt-get update && apt-get install -yq \
10+
RUN apt-get update && apt-get install -yq \
1111
build-essential \
1212
libssl-dev \
1313
zlib1g-dev \
1414
libbz2-dev \
1515
libreadline-dev \
1616
libsqlite3-dev \
17-
curl \
17+
curl \
1818
libncursesw5-dev \
1919
xz-utils \
2020
tk-dev \
@@ -25,7 +25,7 @@ RUN apt-get update && apt-get install -yq \
2525
git \
2626
python3-distutils \
2727
&& rm -rf /var/lib/apt/lists/*
28-
28+
2929
ENV PYENV_ROOT $HOME/.pyenv
3030
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
3131

@@ -57,3 +57,4 @@ RUN poetry install --all-extras --no-root
5757

5858
# Copy the rest of the repository
5959
ADD . .
60+

0 commit comments

Comments
 (0)