forked from Ryan-Riggs/LakeFlow_Confluence
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
91 lines (75 loc) · 3.74 KB
/
Copy pathDockerfile
File metadata and controls
91 lines (75 loc) · 3.74 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
89
90
91
# Start from python image
FROM python:3.9
# Update/install all necessary ubuntu stuff
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
RUN pip install --upgrade setuptools
# Set the working directory
WORKDIR /app
# Set up python
COPY * .
RUN pip install -r requirements.txt
RUN pip install zarr==2.18.2
# Set up R
# Libraries used for spatial stuff
RUN apt-get install -y --no-install-recommends build-essential libgdal-dev gdal-bin libgeos-dev libproj-dev default-libmysqlclient-dev libudunits2-dev
# Use code from the base-image for 4.4.3
# https://github.com/rocker-org/rocker/blob/6fcc5d8dad96fa24438df79cb46451c5534c04ae/r-base/4.4.3/Dockerfile
LABEL org.opencontainers.image.licenses="GPL-2.0-or-later" \
org.opencontainers.image.source="https://github.com/rocker-org/rocker" \
org.opencontainers.image.vendor="Rocker Project" \
org.opencontainers.image.authors="Dirk Eddelbuettel <edd@debian.org>"
## Set a default user. Available via runtime flag `--user docker`
## Add user to 'staff' group, granting them write privileges to /usr/local/lib/R/site.library
## User should also have & own a home directory (for rstudio or linked volumes to work properly).
RUN useradd -s /bin/bash -m docker \
&& usermod -a -G staff docker
## NB: No 'apt-get upgrade -y' in official images, see eg
## https://github.com/docker-library/official-images/pull/13443#issuecomment-1297829291
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ed \
less \
locales \
vim-tiny \
wget \
ca-certificates \
fonts-texgyre \
&& rm -rf /var/lib/apt/lists/*
## Configure default locale, see https://github.com/rocker-org/rocker/issues/19
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.utf8 \
&& /usr/sbin/update-locale LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
## Use Debian unstable via pinning -- new style via APT::Default-Release
RUN echo "deb http://http.debian.net/debian sid main" > /etc/apt/sources.list.d/debian-unstable.list \
&& echo 'APT::Default-Release "testing";' > /etc/apt/apt.conf.d/default \
&& echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/90local-no-recommends
ENV R_BASE_VERSION=4.4.3
# ## During the freeze, new (source) packages are in experimental and we place the binaries in our PPA
# RUN echo "deb http://deb.debian.org/debian experimental main" > /etc/apt/sources.list.d/experimental.list \
# && echo "deb [trusted=yes] https://eddelbuettel.github.io/ppaR400 ./" > /etc/apt/sources.list.d/edd-r4.list
## Now install R and littler, and create a link for littler in /usr/local/bin
RUN apt-get update \
&& apt-get install -y -t unstable --no-install-recommends \
libopenblas0-pthread \
littler \
r-cran-docopt \
r-cran-littler \
r-base=${R_BASE_VERSION}-* \
r-base-dev=${R_BASE_VERSION}-* \
r-base-core=${R_BASE_VERSION}-* \
r-recommended=${R_BASE_VERSION}-* \
&& chown root:staff "/usr/local/lib/R/site-library" \
&& chmod g+ws "/usr/local/lib/R/site-library" \
&& ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \
&& ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \
&& ln -s /usr/lib/R/site-library/littler/examples/installBioc.r /usr/local/bin/installBioc.r \
&& ln -s /usr/lib/R/site-library/littler/examples/installDeps.r /usr/local/bin/installDeps.r \
&& ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
&& ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.R .
RUN Rscript requirements.R
RUN