Skip to content

Commit

Permalink
Install using micromamba
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Jan 5, 2024
1 parent 9d9e55f commit 28e9496
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# Python version can be changed, e.g.
# FROM python:3.8
# FROM ghcr.io/mamba-org/micromamba:1.5.1-focal-cuda-11.3.1
FROM docker.io/python:3.12.0-slim-bookworm

LABEL org.opencontainers.image.authors="FNNDSC <[email protected]>" \
org.opencontainers.image.title="Zero MRI Background" \
org.opencontainers.image.description="Set the background intensity of a MRI to 0"
FROM docker.io/mambaorg/micromamba:1.5.5-bookworm-slim AS micromamba
FROM micromamba AS builder

RUN \
--mount=type=cache,sharing=private,target=/home/mambauser/.mamba/pkgs,uid=57439,gid=57439 \
--mount=type=cache,sharing=private,target=/opt/conda/pkgs,uid=57439,gid=57439 \
micromamba -y -n base install -c conda-forge python=3.12 nibabel=5.2.0 numpy=1.26.3 tqdm=4.66.1

ARG SRCDIR=/usr/local/src/pl-zerobg
ARG SRCDIR=/home/mambauser/pl-zerobg
RUN mkdir "${SRCDIR}"
WORKDIR ${SRCDIR}

COPY requirements.txt .
RUN --mount=type=cache,sharing=private,target=/root/.cache/pip pip install -r requirements.txt
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN pip install -r requirements.txt

COPY . .
ARG extras_require=none
RUN pip install ".[${extras_require}]" \
&& cd / && rm -rf ${SRCDIR}
RUN pip install . && cd / && rm -rf ${SRCDIR}
WORKDIR /

CMD ["zb"]

LABEL org.opencontainers.image.authors="FNNDSC <[email protected]>" \
org.opencontainers.image.title="Zero MRI Background" \
org.opencontainers.image.description="Set the background intensity of a MRI to 0"
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
chris_plugin==0.4.0
nibabel==5.2.0
tqdm==4.66.1
nibabel~=5.2.0
numpy~=1.26.3
tqdm~=4.66.1

0 comments on commit 28e9496

Please sign in to comment.