Skip to content

Commit

Permalink
feat: add in pytorch base image
Browse files Browse the repository at this point in the history
  • Loading branch information
ahodges22 committed Jun 12, 2024
1 parent b11ebb8 commit 2ec1306
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 3.12-pytorch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM articulate/python:3.12

# Environment variables for PyTorch version and CUDA version
# Set build arguments for PyTorch version
ENV PYTORCH_VERSION=2.3.1
ENV TORCHVISION_VERSION=0.18.1
ENV CUDA_VERSION=12.1

# Install PyTorch
RUN CUDA_VERSION_SANITIZED=$(echo $CUDA_VERSION | tr -d '.') && \

Check failure on line 10 in 3.12-pytorch/Dockerfile

View workflow job for this annotation

GitHub Actions / lint (3.12-pytorch/Dockerfile)

DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`

Check failure on line 10 in 3.12-pytorch/Dockerfile

View workflow job for this annotation

GitHub Actions / lint (3.12-pytorch/Dockerfile)

DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

Check failure on line 10 in 3.12-pytorch/Dockerfile

View workflow job for this annotation

GitHub Actions / lint (3.12-pytorch/Dockerfile)

SC2086 info: Double quote to prevent globbing and word splitting.
pip install --no-cache-dir torch==${PYTORCH_VERSION} torchaudio==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} torchvision torchaudio \
--index-url https://download.pytorch.org/whl/cu${CUDA_VERSION_SANITIZED}

# Our entrypoint will pull in our environment variables from Consul and Vault,
# and execute whatever command we provided the container.
# See https://github.com/articulate/docker-bootstrap
ENTRYPOINT [ "dumb-init", "--", "/entrypoint" ]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Base Python Docker images.
> 🌟 recommended image
* __articulate/python:3.12__ 🌟
* articulate/python:3.12-pytorch
* articulate/python:3.11

## Creating a new image
Expand Down

0 comments on commit 2ec1306

Please sign in to comment.