Skip to content

Commit c8c5f8d

Browse files
committed
🔧 Update Poetry version and adjust cache directory permissions in Dockerfile
Also update uv installation method
1 parent c5464b8 commit c8c5f8d

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

‎Dockerfile‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,36 @@
22
ARG USERNAME=ContainerUser
33
ARG PYTHONVERSION=3.11
44

5+
# ############################################################################################################
56
FROM python:${PYTHONVERSION} AS python-base
67

7-
ENV POETRY_VERSION=2.0.1
8+
ENV POETRY_VERSION=2.1.1
89
ENV POETRY_CACHE_DIR=/var/cache/poetry \
910
POETRY_HOME=/opt/poetry \
1011
PATH=/opt/poetry/bin:${PATH}\
1112
PYTHONFAULTHANDLER=1 \
1213
PYTHONUNBUFFERED=1 \
13-
PIP_DISABLE_PIP_VERSION_CHECK=on \
14-
PIP_CACHE_DIR=/var/cache/pip \
15-
UV_CACHE_DIR=/var/cache/uv \
16-
UV_LINK_MODE=copy
17-
RUN mkdir -p $PIP_CACHE_DIR $POETRY_CACHE_DIR $UV_CACHE_DIR
18-
14+
PIP_CACHE_DIR=/var/cache/pip
15+
RUN mkdir -p $PIP_CACHE_DIR $POETRY_CACHE_DIR
1916

17+
# ############################################################################################################
2018
FROM python-base AS poetry-base
2119

2220
# Poetry install
2321
RUN set -x; \
2422
curl -sSL https://install.python-poetry.org | python3 - \
2523
&& poetry self add poetry-bumpversion
2624

27-
25+
# ############################################################################################################
2826
FROM python-base AS devcontainer
2927
ARG USERNAME
3028
LABEL org.opencontainers.image.source=https://github.com/OpenJKSoftware/python-devcontainer
3129

3230
# Install uv
3331
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
32+
ENV UV_CACHE_DIR=/var/cache/uv \
33+
UV_LINK_MODE=copy
34+
RUN mkdir -p $UV_CACHE_DIR
3435

3536
# Install Base Reqs
3637
COPY scripts/install_base_deps.sh /tmp/
@@ -63,15 +64,15 @@ RUN set -x; \
6364

6465
# Copy Poetry from other stage and add to path
6566
COPY --from=poetry-base --chown=${USERNAME}:${USERNAME} ${POETRY_HOME} ${POETRY_HOME}
66-
RUN chown -R ${USERNAME}:${USERNAME} $PIP_CACHE_DIR $POETRY_CACHE_DIR $UV_CACHE_DIR
67+
RUN bash -c "chown -R ${USERNAME}:${USERNAME} {${PIP_CACHE_DIR},${POETRY_CACHE_DIR},${UV_CACHE_DIR}}"
6768

6869
# Non Root User
6970
USER ${USERNAME}
7071
WORKDIR /home/${USERNAME}
7172

7273
# Oh-My-Zsh user config
7374
RUN set -x ; \
74-
mkdir -p {.zfunc,.commandhistory} \
75+
bash -c "mkdir -p {.zfunc,.commandhistory}" \
7576
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
7677
COPY --chown=${USERNAME}:${USERNAME} .zshrc .zshrc
7778

0 commit comments

Comments
 (0)