Skip to content

Commit

Permalink
Fix more recent pants installations under docker
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysyngsun committed Jun 24, 2024
1 parent 4e48e30 commit 3af84e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,23 @@ RUN pyenv install 3.10
FROM pyenv as py311
RUN pyenv install 3.11

# ===================================================================
FROM base as pants
RUN curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash

# ===================================================================
FROM pyenv as shell

ENV PATH="${PATH}:/home/dev/bin"

RUN curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash
RUN <<EOT bash
echo 'export PATH="$PATH:\$HOME/.local/bin"' >> ~/.bashrc
EOT

# the pants installer puts things in ~/cache/nce and it needs to be persistent
RUN mkdir -p .cache && chown dev:dev .cache

COPY --from=pants /home/dev/bin ./bin

# these are all separate stages to make them build in parallel
COPY --from=py38 /home/dev/.pyenv/versions ./.pyenv/versions/
COPY --from=py39 /home/dev/.pyenv/versions ./.pyenv/versions/
COPY --from=py310 /home/dev/.pyenv/versions ./.pyenv/versions/
COPY --from=py311 /home/dev/.pyenv/versions ./.pyenv/versions/

VOLUME /home/dev/.cache
WORKDIR /home/dev/src
WORKDIR /home/dev/src
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ To perform a release, run:

#### Use the docker-compose container (recommended)

- You'll need to make sure other users (the docker container user), can write to the repo root directory. Run `chmod o+w .`
- Run `docker compose run --rm shell bash` to get a clean sandbox environment

#### Use on your host system
Expand Down

0 comments on commit 3af84e3

Please sign in to comment.