Last active
January 30, 2023 23:52
-
-
Save JoshuaSchlichting/1268fe4088588287ae9b3383b2dcea75 to your computer and use it in GitHub Desktop.
Interactive Python Docker container with Poetry installed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| docker build -t pyshell . -f-<<EOF | |
| FROM python:latest | |
| RUN useradd -m -U -G staff -s /bin/bash devuser | |
| USER devuser | |
| WORKDIR /home/devuser | |
| RUN mkdir /home/devuser/bin | |
| ENV POETRY_HOME="/home/devuser/bin/poetry" | |
| RUN curl -sSL https://install.python-poetry.org | python - | |
| ENV PATH="/home/devuser/bin/poetry/bin:$PATH" | |
| RUN poetry config virtualenvs.create false | |
| ENTRYPOINT [ "/bin/bash" ] | |
| EOF | |
| } || { | |
| echo "Failed to build docker image"; exit 1; | |
| } | |
| docker run \ | |
| --rm \ | |
| -it \ | |
| --name pyshell \ | |
| --volume $(pwd):/workdir \ | |
| -v $PWD:/workdir \ | |
| -w /workdir \ | |
| pyshell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment