genomicsaotearoa / ewas_dap Goto Github PK
View Code? Open in Web Editor NEWEWAS Data Analysis
EWAS Data Analysis
There are several RUN
commands. Each creating a layer. Changes in the Dockerfile may result in several layers being—possibly—unnecessarily re-created.
Here's a possible version:
FROM php:7.4-apache
# Copy files
COPY src/ /var/www/html
COPY php.ini $PHP_INI_DIR/conf.d/
COPY ports.conf /etc/apache2/ports.conf
COPY main.sh main.sh
COPY dependencies/ /usr/local/lib/R/site-library/mailR/java
# System dependencies
RUN echo 'deb http://cloud.r-project.org/bin/linux/debian buster-cran40/' >> /etc/apt/sources.list && \
apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF' && \
apt-get update && \
apt-get install -y -t
gnupg2 \
buster-cran40 \
r-base \
r-base-dev \
r-recommendedlibssl-dev \
libcurl4-openssl-dev \
libxml2-dev \
msmtp \
default-jre \
default-jdk && \
mkdir /usr/share/man/man1/ && \
rm -rf /var/lib/apt/lists/*
# R configuration and dependencies
RUN R CMD javareconf && \
Rscript /var/www/html/install_packages.R && \
chmod +x /var/www/html/sws/csvtk
EXPOSE 8083
That way, changing something int he R configuration & dependencies, should be much quicker, since it will only run that layer.
Changing any dependencies, won't trigger new COPY
commands as those are executed before (creating layers).
See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ there's more that can be applied in the Dockerfile
to speed up the build, and possibly reduce the final image size too. I've only included one command above to clear apt
files, but there are other good tips in there 👍
Without a .dockerignore
, Docker will send everything in the build directory for the build context.
kinow@ranma:~/Development/python/workspace/EWAS_DAP$ ./build_docker
Sending build context to Docker daemon 80.92MB
I added just .git
and jupyterhub
for a quick experiment.
kinow@ranma:~/Development/python/workspace/EWAS_DAP$ ./build_docker
Sending build context to Docker daemon 26.51MB
That reduces risks of accidentally including sensitive info in the build context, and may improve the build time for the Docker container.
See: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#exclude-with-dockerignore
In the readme, it points the user to use sudo
for building a Docker container. But if users have right group access in the operating system, there's no need for sudo
. Only when using the privileged mode for running I think.
I've successfully built it without the sudo
(though it took ages, which is normal 😬 I believe).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.