Skip to content

Commit 0cb3653

Browse files
authored
Merge pull request #18 from jdkent/fix_singularity
[FIX] singularity build process
2 parents 2de4869 + ee92257 commit 0cb3653

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# https://github.com/kaczmarj/neurodocker
1010

11-
FROM hbclab/accel-bids
11+
FROM hbclab/accel-bids:unstable
1212

1313
USER root
1414

Dockerfile_exec

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ FROM ubuntu:18.04
33

44
USER root
55

6+
ENV ND_ENTRYPOINT="/neurodocker/startup.sh"
7+
8+
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
9+
&& mkdir -p /neurodocker \
10+
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
11+
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
12+
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
13+
&& echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \
14+
&& echo 'source activate accel' >> "$ND_ENTRYPOINT" \
15+
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
16+
fi \
17+
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
18+
619
# Get base utilities
720
RUN apt-get update \
821
&& apt-get -y install curl \
@@ -11,14 +24,15 @@ RUN apt-get update \
1124
# Conda install
1225
ENV PATH="/opt/miniconda-latest/bin:$PATH"
1326

27+
RUN useradd --create-home --shell /bin/bash coder
28+
USER coder
29+
1430
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
1531
&& conda_installer="/tmp/miniconda.sh" \
1632
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
1733
&& bash "$conda_installer" -b -p /opt/miniconda-latest
1834

1935

20-
RUN useradd --create-home --shell /bin/bash coder
21-
USER coder
2236
RUN mkdir /home/coder/projects
2337
WORKDIR /home/coder/projects
2438

@@ -29,4 +43,4 @@ RUN conda env create -f environment.yml
2943
RUN bash -c 'conda init && . /home/coder/.bashrc && . activate accel && pip install -e /home/coder/projects'
3044

3145
# Run as executable
32-
ENTRYPOINT ["conda", "run", "-n", "accel", "python", "/home/coder/projects/accel_code/run.py"]
46+
ENTRYPOINT ["/neurodocker/startup.sh", "accel_transform"]

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
from setuptools import setup, find_packages
22

3-
setup(name="accel-code", packages=find_packages())
3+
setup(
4+
name="accel-code", packages=find_packages(),
5+
entry_points={
6+
"console_scripts": [
7+
"accel_transform = accel_code.run:main",
8+
],
9+
},
10+
)

0 commit comments

Comments
 (0)