Skip to content

Commit 166580e

Browse files
author
Dominik Falkner
committed
feat: Support commands installed via poetry (black, ...) by initializing pyenv in .bashrc
1 parent a29109f commit 166580e

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
3333
RUN set -ex \
3434
&& curl https://pyenv.run | bash \
3535
&& pyenv update \
36-
&& eval "$(pyenv init -)" && pyenv --version
36+
&& eval "$(pyenv init -)" \
37+
# activate pyenv on shell start
38+
&& pyenv init - > ~/.bashrc
3739

3840
# Install python and set interpreter
3941
RUN pyenv install -s ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
3737
RUN set -ex \
3838
&& curl https://pyenv.run | bash \
3939
&& pyenv update \
40-
&& eval "$(pyenv init -)" && pyenv --version
40+
&& eval "$(pyenv init -)" \
41+
# activate pyenv on shell start
42+
&& pyenv init - > ~/.bashrc
4143

4244
# Install python and set interpreter
4345
RUN pyenv install -s ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION}
@@ -62,4 +64,4 @@ RUN poetry install --all-extras --no-root
6264
# Copy the rest of the repository
6365
ADD . .
6466

65-
ENTRYPOINT ["tail", "-f", "/dev/null"]
67+
ENTRYPOINT ["tail", "-f", "/dev/null"]

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
3333
RUN set -ex \
3434
&& curl https://pyenv.run | bash \
3535
&& pyenv update \
36-
&& eval "$(pyenv init -)" && pyenv --version
36+
&& eval "$(pyenv init -)" \
37+
# activate pyenv on shell start
38+
&& pyenv init - > ~/.bashrc
3739

3840
# Install python and set interpreter
3941
RUN pyenv install -s ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION}

0 commit comments

Comments
 (0)