Last active
March 20, 2023 13:36
-
-
Save lanmaster53/b06c0700c149dd2a2a563ce69f054d82 to your computer and use it in GitHub Desktop.
Docker image for running Python 3 scripts in a throw-away environment.
This file contains 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
FROM python:slim | |
ENV PYTHONDONTWRITEBYTECODE 1 | |
ENV PYTHONUNBUFFERED 1 | |
ENV TZ America/New_York | |
RUN mkdir -p /src | |
WORKDIR /src | |
ENTRYPOINT ["/bin/bash"] | |
# 1. Build the Docker image using the following command. This only needs to be done once. | |
# * `docker build --rm -t python3-base .` | |
# 2. Run a container from the same directory as the script using the following command. | |
# * `docker run --rm -it -v $(pwd):/src python3-base` | |
# 3. Use the CLI to install needed dependencies via `pip`. | |
# 4. Run the script. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment