-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Docker Build to overcome Github Runner space issues (#1778)
* Optimize docker build Signed-off-by: Sachidanand Alle <[email protected]> * Optimize docker build Signed-off-by: Sachidanand Alle <[email protected]> * Optimize docker build Signed-off-by: Sachidanand Alle <[email protected]> * Optimize docker build Signed-off-by: Sachidanand Alle <[email protected]> * Optimize docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> * Fix docker build Signed-off-by: Sachidanand Alle <[email protected]> --------- Signed-off-by: Sachidanand Alle <[email protected]>
- Loading branch information
1 parent
6cb96f6
commit ea9e302
Showing
15 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,28 +11,32 @@ | |
|
||
# To build with a different base image | ||
# please run `./runtests.sh --clean && DOCKER_BUILDKIT=1 docker build -t projectmonai/monailabel:latest .` | ||
# to use different version of MONAI pass `--build-arg MONAI_IMAGE=...` | ||
# to use different version of MONAI pass `--build-arg FINAL_IMAGE=...` | ||
|
||
ARG MONAI_IMAGE=projectmonai/monai:1.4.0 | ||
#ARG FINAL_IMAGE=pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime | ||
ARG FINAL_IMAGE=ubuntu:22.04 | ||
ARG BUILD_IMAGE=python:3.10 | ||
ARG NODE_IMAGE=node:slim | ||
|
||
# Phase1: Build OHIF Viewer | ||
FROM ${NODE_IMAGE} AS ohifbuild | ||
ADD ./plugins/ohifv3 /opt/ohifv3 | ||
COPY plugins/ohifv3 /opt/ohifv3 | ||
RUN apt update -y && apt install -y git | ||
RUN cd /opt/ohifv3 && ./build.sh /opt/ohifv3/release | ||
|
||
FROM ${MONAI_IMAGE} AS build | ||
LABEL maintainer="[email protected]" | ||
|
||
# Phase2: Build MONAI Label Package | ||
FROM ${BUILD_IMAGE} AS build | ||
WORKDIR /opt/monailabel | ||
RUN python -m pip install pip setuptools wheel twine | ||
ADD . /opt/monailabel/ | ||
COPY --from=ohifbuild /opt/ohifv3/release /opt/monailabel/monailabel/endpoints/static/ohif | ||
RUN python -m pip install --upgrade --no-cache-dir pip setuptools wheel twine \ | ||
&& cd /opt/monailabel \ | ||
&& BUILD_OHIF=false python setup.py sdist bdist_wheel --build-number $(date +'%Y%m%d%H%M') | ||
RUN BUILD_OHIF=false python setup.py bdist_wheel --build-number $(date +'%Y%m%d%H%M') | ||
|
||
FROM ${MONAI_IMAGE} | ||
# Phase3: Build Final Docker | ||
FROM ${FINAL_IMAGE} | ||
LABEL maintainer="[email protected]" | ||
|
||
WORKDIR /opt/monailabel | ||
RUN apt update -y && apt install -y git curl openslide-tools python3 python-is-python3 python3-pip | ||
RUN python -m pip install --no-cache-dir pytest torch torchvision torchaudio | ||
COPY --from=build /opt/monailabel/dist/monailabel* /opt/monailabel/dist/ | ||
RUN python -m pip install --upgrade --no-cache-dir pip \ | ||
&& python -m pip install /opt/monailabel/dist/monailabel*.whl | ||
RUN python -m pip install --no-cache-dir /opt/monailabel/dist/monailabel*.whl |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.33 MB
(1.9%)
docs/images/quickstart/monai-label-plugin-favorite-modules-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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