-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
53 lines (43 loc) · 1.52 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM ubuntu:20.04
# Label
LABEL org.opencontainers.image.title="fish cropping and trait morphology"
LABEL org.opencontainers.image.authors=" T. Tabarin"
LABEL org.opencontainers.image.source="https://github.com/hdr-bgnn/BGNN_Snakemake"
# Install some basic utilities
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
wget \
&& rm -rf /var/lib/apt/lists/*
# Create a working directory
RUN mkdir /app
WORKDIR /app
# Create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
&& chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user
# All users can use /home/user as their home directory
ENV HOME=/home/user
RUN chmod 777 /home/user
# Set up the Conda environment
ENV CONDA_AUTO_UPDATE_CONDA=false \
PATH=/home/user/miniconda/bin:$PATH
COPY crop_env.yml /app/environment.yml
RUN curl -sLo ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh \
&& chmod +x ~/miniconda.sh \
&& ~/miniconda.sh -b -p ~/miniconda \
&& rm ~/miniconda.sh \
&& conda env update -n base -f /app/environment.yml \
&& rm /app/environment.yml \
&& conda clean -ya
WORKDIR /pipeline
# Setup pipeline specific scripts
ENV PATH="/pipeline/Crop:${PATH}"
ADD Crop_image_main.py /pipeline/Crop/Crop_image_main.py
# Set the default command to a usage statement
CMD echo "Usage crop: Crop_image_main.py <input_image.jpg> <image_metadata.json> <image_cropped.png>\n"\