forked from FNNDSC/pl-monai_spleenseg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (27 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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.1-slim-bookworm
LABEL org.opencontainers.image.authors="FNNDSC <dev@babyMRI.org>" \
org.opencontainers.image.title="Spleen 3D image segmentation training (MONAI)" \
org.opencontainers.image.description="A ChRIS based off project MONAI's spleen segmenation notebook (training only)"
ARG SRCDIR=/usr/local/src/pl-monai_spleenseg
WORKDIR ${SRCDIR}
COPY requirements.txt .
# RUN --mount=type=cache,sharing=private,target=/root/.cache/pip pip install -r requirements.txt
RUN pip install scikit-build
RUN pip install -r requirements.txt
COPY . .
ARG extras_require=none
RUN pip install ".[${extras_require}]" \
&& cd / && rm -rf ${SRCDIR}
# Create the 'localuser' group with specified GID
RUN groupadd -g 1001 localuser
# Create the 'localuser' user with specified UID, add to the group, and create home directory
RUN useradd -u 1001 -g localuser -m -s /bin/bash localuser
# Grant sudo privileges to the 'localuser' user
RUN apt-get update && apt-get install -y sudo
RUN echo '%localuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
#USER localuser
WORKDIR ${SRCDIR}
CMD ["spleenseg"]