-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (69 loc) · 2.32 KB
/
Dockerfile
File metadata and controls
88 lines (69 loc) · 2.32 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Start from the fredericklab base container
FROM fredericklab/basecontainer:latest-release
# get build arguments
ARG BUILD_TIME
ARG BRANCH
ARG GITVERSION
ARG GITDIRECTVERSION
ARG GITSHA
ARG GITDATE
# set and echo environment variables
ENV BUILD_TIME=$BUILD_TIME
ENV BRANCH=$BRANCH
ENV GITVERSION=${GITVERSION}
ENV GITSHA=${GITSHA}
ENV GITDATE=${GITDATE}
ENV GITDIRECTVERSION=${GITDIRECTVERSION}
RUN echo "BRANCH: "$BRANCH
RUN echo "BUILD_TIME: "$BUILD_TIME
RUN echo "GITVERSION: "$GITVERSION
RUN echo "GITSHA: "$GITSHA
RUN echo "GITDATE: "$GITDATE
RUN echo "GITDIRECTVERSION: "$GITDIRECTVERSION
# Installing precomputed python packages
RUN uv pip install pillow
# security patches
RUN uv pip install "cryptography>=42.0.4" "urllib3>=1.26.17"
# copy PICAchooser into container
COPY . /src/picachooser
RUN echo $GITVERSION > /src/picachooser/VERSION
# init and install picachooser
RUN uv pip install --upgrade pip
RUN cd /src/picachooser && \
uv pip install .
RUN chmod -R a+r /src/picachooser
# clean up build directories
RUN rm -rf /src/picachooser/build /src/picachooser/dist
# update the paths to libraries
RUN ldconfig
# set a flag so we know we're in a container
ENV RUNNING_IN_CONTAINER=1
# clean up
RUN pip cache purge
# Create a shared $HOME directory
ENV USER=picachooser
RUN useradd \
--create-home \
--shell /bin/bash \
--groups users \
--home /home/$USER \
$USER
RUN chown -R $USER /src/$USER
WORKDIR /home/$USER
ENV HOME="/home/picachooser"
# set to non-root user
USER picachooser
# initialize user mamba
RUN /opt/miniforge3/bin/mamba shell init --shell bash
RUN echo "mamba activate science" >> /home/picachooser/.bashrc
# set up variable for non-interactive shell
ENV PATH=/opt/miniforge3/envs/science/bin:/opt/miniforge3/condabin:.:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WORKDIR /tmp/
ENTRYPOINT ["/opt/miniforge3/envs/science/bin/PICAchooser_dispatcher"]
LABEL org.label-schema.build-date=$BUILD_TIME \
org.label-schema.name="picachooser" \
org.label-schema.description="PICAchooser - a lightweight GUI tool for sorting MELODIC ICA components" \
org.label-schema.url="http://nirs-fmri.net" \
org.label-schema.vcs-ref=$GITVERSION \
org.label-schema.vcs-url="https://github.com/bbfrederick/picachooser" \
org.label-schema.version=$GITVERSION