Skip to content

Commit c7f4c0e

Browse files
committed
use HOME paths instead of hardcoding
1 parent 6d0f25f commit c7f4c0e

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Dockerfile_alpine

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ RUN apk add --no-cache \
2222
&& mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com github.com | sort > ~/.ssh/known_hosts \
2323
# install pyenv
2424
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
25-
&& echo 'export PATH="/root/.pyenv/bin:/root/.cargo/bin:$PATH"' >> /root/.profile \
26-
&& echo 'eval "$(pyenv init --path)"' >> /root/.profile \
25+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile \
26+
&& echo 'export PATH="$PYENV_ROOT/bin:$HOME/.cargo/bin:$PATH"' >> ~/.profile \
27+
&& echo 'eval "$(pyenv init --path)"' >> ~/.profile \
2728
&& true
2829

2930
SHELL ["/bin/bash", "-lc"]
@@ -63,7 +64,7 @@ FROM pyenv as tox-base
6364
COPY docker-entrypoint-tox.sh /
6465
RUN python -m pip install -U tox \
6566
&& curl -sSL https://install.python-poetry.org | python3 - \
66-
&& echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.profile \
67+
&& echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile \
6768
&& true
6869
ONBUILD COPY . /app
6970
WORKDIR /app

Dockerfile_debian

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ RUN apt-get update \
2929
&& mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com github.com | sort > ~/.ssh/known_hosts \
3030
# install pyenv
3131
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
32-
&& echo 'export PATH="/root/.pyenv/bin:$HOME/.cargo/bin:$PATH"' >> /root/.profile \
33-
&& echo 'eval "$(pyenv init --path)"' >> /root/.profile \
32+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile \
33+
&& echo 'export PATH="$PYENV_ROOT/bin:$HOME/.cargo/bin:$PATH"' >> ~/.profile \
34+
&& echo 'eval "$(pyenv init --path)"' >> ~/.profile \
3435
&& true
3536

3637
SHELL ["/bin/bash", "-lc"]
@@ -69,7 +70,7 @@ FROM pyenv as tox-base
6970
COPY docker-entrypoint-tox.sh /
7071
RUN python -m pip install -U tox \
7172
&& curl -sSL https://install.python-poetry.org | python3 - \
72-
&& echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.profile \
73+
&& echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile \
7374
&& true
7475
ONBUILD COPY . /app
7576
WORKDIR /app

Dockerfile_ubuntu

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ RUN apt-get update \
3030
&& mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com github.com | sort > ~/.ssh/known_hosts \
3131
# install pyenv
3232
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
33-
&& echo 'export PATH="/root/.pyenv/bin:/root/.cargo/bin:$PATH"' >> /root/.profile \
34-
&& echo 'eval "$(pyenv init --path)"' >> /root/.profile \
33+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile \
34+
&& echo 'export PATH="$PYENV_ROOT/bin:$HOME/.cargo/bin:$PATH"' >> ~/.profile \
35+
&& echo 'eval "$(pyenv init --path)"' >> ~/.profile \
3536
&& true
3637

3738
SHELL ["/bin/bash", "-lc"]
@@ -70,7 +71,7 @@ FROM pyenv as tox-base
7071
COPY docker-entrypoint-tox.sh /
7172
RUN python -m pip install -U tox \
7273
&& curl -sSL https://install.python-poetry.org | python3 - \
73-
&& echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.profile \
74+
&& echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile \
7475
&& true
7576
ONBUILD COPY . /app
7677
WORKDIR /app

0 commit comments

Comments
 (0)