-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Docker] Simplify and modernize Dockerfile #3290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9f0ff5d
move deeplabcut-docker package to separate subdirectory
deruyter92 26ea5b6
update dockerfile: add single clean dockerfile that replaces the mult…
deruyter92 a80e426
docker: replace build script with docker bake buildx hcl file
deruyter92 0748560
add dockerignore file
deruyter92 7547079
docker update README: new dockerfile naming and buildx commands
deruyter92 04646e6
Update docker/README.md
deruyter92 99d31cd
Update docker/Dockerfile
deruyter92 ead4b7c
Update dockerfile: fix pretrained weights directory permission
deruyter92 ff549d1
dockerfile: add healthcheck for jupyter exposed port
deruyter92 8d45764
dockerfile: add override jupyter token option + port-expose warning i…
deruyter92 b73c99f
dockerfile: add comment regarding root-user
deruyter92 551237b
[Docker 2] update `deeplabcut-docker` package (#3291)
deruyter92 55f13a4
Merge branch 'main' into jaap/update_docker
C-Achard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| examples/ | ||
| package/ | ||
| README.md | ||
| docker-bake.hcl | ||
| .gitignore |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| ARG PYTORCH_VERSION=2.5.1 | ||
| ARG CUDA_VERSION=12.4 | ||
| ARG CUDNN_VERSION=9 | ||
| ARG DEEPLABCUT_VERSION=3.0.0rc14 | ||
|
|
||
| # ── core ────────────────────────────────────────────────────────────────────── | ||
| FROM pytorch/pytorch:${PYTORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-runtime AS core | ||
|
|
||
| ARG DEEPLABCUT_VERSION | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| RUN apt-get update -yy && \ | ||
| apt-get install -yy --no-install-recommends \ | ||
| libgl1 \ | ||
| libglib2.0-0 \ | ||
| build-essential \ | ||
| git \ | ||
| ffmpeg \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install --upgrade pip && \ | ||
| pip install "deeplabcut[modelzoo,wandb]==${DEEPLABCUT_VERSION}" | ||
|
|
||
| # Create pretrained weights directory and make it writable | ||
| # (same default as HuggingFaceWeightsMixin in backbones/base.py: Path(__file__).parent / "pretrained_weights") | ||
| RUN PRETRAINED=$(python -c "from pathlib import Path; import deeplabcut.pose_estimation_pytorch.models.backbones.base as b; print(Path(b.__file__).parent / 'pretrained_weights')") && \ | ||
| mkdir -p "$PRETRAINED" && \ | ||
| chmod a+rwx -R "$PRETRAINED" | ||
|
|
||
| RUN mkdir -p /app && chmod a+rwx /app | ||
|
deruyter92 marked this conversation as resolved.
|
||
|
|
||
| COPY motd.sh /home/motd.sh | ||
| RUN echo "source /home/motd.sh" >> /etc/profile | ||
|
|
||
| ENV CUDA_VERSION=${CUDA_VERSION} | ||
| ENV PYTORCH_VERSION=${PYTORCH_VERSION} | ||
| ENV DEEPLABCUT_VERSION=${DEEPLABCUT_VERSION} | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # ── jupyter ─────────────────────────────────────────────────────────────────── | ||
| # (runs as root intentionally; deeplabcut-docker adds a host-matched user at runtime) | ||
| FROM core AS jupyter | ||
|
|
||
| ENV NOTEBOOK_TOKEN=deeplabcut | ||
|
|
||
| RUN pip install "notebook<7" | ||
|
deruyter92 marked this conversation as resolved.
|
||
| EXPOSE 8888 | ||
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | ||
| CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8888/api/', timeout=3).read()" || exit 1 | ||
| ENTRYPOINT ["jupyter", "notebook", \ | ||
| "--no-browser", "--NotebookApp.token=${NOTEBOOK_TOKEN}", "--ip", "0.0.0.0"] | ||
|
|
||
| # ── test (CI only, not published to Hub) ───────────────────────────────────── | ||
| FROM core AS test | ||
|
|
||
| RUN pip install --no-cache-dir pytest | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.