diff --git a/docker/base/install_pythons.sh b/docker/base/install_pythons.sh index 62f6a4ef5..128fcc6d1 100755 --- a/docker/base/install_pythons.sh +++ b/docker/base/install_pythons.sh @@ -18,13 +18,13 @@ PYENV_VERSIONS=( 3.10.14 3.12.3 3.13.0a6 - pypy2.7-7.3.15 + pypy2.7-7.3.16 pypy3.5-7.0.0 pypy3.6-7.3.3 pypy3.7-7.3.9 pypy3.8-7.3.11 - pypy3.9-7.3.15 - pypy3.10-7.3.15 + pypy3.9-7.3.16 + pypy3.10-7.3.16 ) git clone "${PYENV_REPO:-https://github.com/pyenv/pyenv.git}" "${PYENV_ROOT}" && ( cd "${PYENV_ROOT}" && git checkout "${PYENV_SHA:-HEAD}" && src/configure && make -C src diff --git a/docker/user/Dockerfile b/docker/user/Dockerfile index a42a3a013..25768a50a 100644 --- a/docker/user/Dockerfile +++ b/docker/user/Dockerfile @@ -25,17 +25,6 @@ ENV _PEX_TEST_DEV_ROOT=/development/pex_dev # ~/.pex cache. VOLUME "/home/${USER}/.pex" -RUN mkdir -p \ - /development/pex \ - /development/pex/.tox \ - /development/pex_dev \ - "/home/${USER}/.pex" && \ - chown -R "${UID}:${GID}" \ - /development/pex \ - /development/pex/.tox \ - /development/pex_dev \ - "/home/${USER}/.pex" - # This will be a named volume used to persist the pytest tmp tree (/tmp/pytest-of-$USER/) for use \ # in `./dtox inspect` sessions. VOLUME /tmp diff --git a/dtox.sh b/dtox.sh index 2982af89a..8e258634c 100755 --- a/dtox.sh +++ b/dtox.sh @@ -27,6 +27,7 @@ elif [[ "${BASE_MODE}" == "pull" ]]; then docker pull "ghcr.io/pex-tool/pex/base:${base_hash}" fi +CONTAINER_HOME="/home/$(id -un)" USER_INPUT=( "${BASE_INPUT[@]}" "${ROOT}/docker/user/Dockerfile" @@ -48,6 +49,23 @@ if [[ -z "$(user_image_id)" ]]; then --tag pex-tool/pex/user:latest \ --tag "pex-tool/pex/user:${user_hash}" \ "${ROOT}/docker/user" + + docker run \ + --rm \ + --volume pex-caches:/development/pex_dev \ + --volume "pex-root:${CONTAINER_HOME}/.pex" \ + --volume pex-tmp:/tmp \ + --volume pex-tox:/development/pex/.tox \ + --entrypoint bash \ + --user root \ + "pex-tool/pex/user:${user_hash}" \ + -c " + chown -R $(id -un):$(id -gn) \ + /development/pex_dev \ + ${CONTAINER_HOME}/.pex \ + /tmp \ + /development/pex/.tox + " fi if [[ "${CACHE_MODE}" == "pull" ]]; then @@ -99,11 +117,6 @@ if [[ -n "${TERM:-}" ]]; then ) fi -# This ensures the current user owns the host .tox/ dir before launching the container, which -# otherwise sets the ownership as root for undetermined reasons -mkdir -p "${ROOT}/.tox" - -CONTAINER_HOME="/home/$(id -un)" exec docker run \ --rm \ --volume pex-tmp:/tmp \