aboutsummaryrefslogtreecommitdiff
path: root/doc/docker-container.org
diff options
context:
space:
mode:
authorzsloan2020-10-08 14:34:23 -0500
committerzsloan2020-10-08 14:34:23 -0500
commit46232706289575e1798442f3a763aaf1407ec6fa (patch)
treec4c383ce09efd240f279f5bc6564eebdcf583169 /doc/docker-container.org
parent04a2cb3fd909598b4c51baa63229f8609aa90999 (diff)
parent4f47ebdac92a4255c9a12aa7235affc777114268 (diff)
downloadgenenetwork2-46232706289575e1798442f3a763aaf1407ec6fa.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into testing
Diffstat (limited to 'doc/docker-container.org')
-rw-r--r--doc/docker-container.org61
1 files changed, 32 insertions, 29 deletions
diff --git a/doc/docker-container.org b/doc/docker-container.org
index 3c9864c5..ec91824a 100644
--- a/doc/docker-container.org
+++ b/doc/docker-container.org
@@ -15,57 +15,60 @@ are ran from.
Find instructions on how to set docker up inside GUIX [[https://github.com/pjotrp/guix-notes/blob/master/CONTAINERS.org#run-docker][here]]. This
document will not get into that. It's assumed that you have a working
-dockec setup.
+docker setup.
The rest of this document outlines how the docker container used in
-the CI builds were created.
+the CI builds was created.
* Creating the Docker Images
-First create the image by running:
+The general idea is that GUIX is used to generate a set of binaries,
+which will be added to a base mariaDB image.
+
+First create the gn2 tar archive by running:
#+begin_src sh
# For the Python 2 version:
-env GUIX_PACKAGE_PATH="/home/bonface/projects/guix-bioinformatics::/home/bonface/projects/guix-past/modules" \
- ./pre-inst-env guix pack -f docker --no-grafts \
- -S /usr/bin=/bin -S /etc/profile=/etc/profile \
- -S /share/genenetwork2=/share/genenetwork2 \
- -S /share/javascript=/share/javascript \
- -S /lib=/lib \
- -S /usr/gn2-profile=/ \
- coreutils bash genenetwork2
+env GUIX_PACKAGE_PATH="/home/bonface/projects/guix-bioinformatics:/home/bonface/projects/guix-past/modules" \
+ ./pre-inst-env guix pack --no-grafts\
+ -S /gn2-profile=/ \
+ screen genenetwork2
# For the Python 3 version:
-env GUIX_PACKAGE_PATH="/home/bonface/projects/guix-bioinformatics::/home/bonface/projects/guix-past/modules" \
- ./pre-inst-env guix pack -f docker --no-grafts \
- -S /usr/bin=/bin -S /etc/profile=/etc/profile \
- -S /share/genenetwork2=/share/genenetwork2 \
- -S /share/javascript=/share/javascript \
- -S /lib=/lib \
- -S /usr/gn2-profile=/ \
- coreutils bash python3-genenetwork2
+env GUIX_PACKAGE_PATH="/home/bonface/projects/guix-bioinformatics:/home/bonface/projects/guix-past/modules" \
+ ./pre-inst-env guix pack --no-grafts\
+ -S /gn2-profile=/ \
+ screen python3-genenetwork2
#+end_src
The output will look something similar to:
-: /gnu/store/dj1xh19jq1l9vwq24w3nay2954x0wabb-docker-pack.tar.gz
+: /gnu/store/x3m77vwaqcwba24p5s4lrb7w2ii16lj9-tarball-pack.tar.gz
+
+Now create a folder from which will host the following dockerfile. You
+can name this file Dockerfile. Note that mariadb is the base image
+since it already has mariadb installed for us.
+
+#+begin_src conf :mkdirp yes :tangle ~/docker/Dockerfile
+FROM mariadb:latest
-Load the docker image by running:
+COPY ./gn2.tar.gz /tmp/gn2.tar.gz
+RUN tar -xzf /tmp/gn2.tar.gz -C / && rm -f /tmp/gn2.tar.gz && \
+ mkdir -p /usr/local/mysql /genotype_files/genotype/json
+#+end_src
-: docker load --input /gnu/store/dj1xh19jq1l9vwq24w3nay2954x0wabb-docker-pack.tar.gz
+Build the image(Note the fullstop at the end):
-Results look something similar to:
+: sudo docker build -t python2-genenetwork2:latest -f Dockerfile .
-#+begin_export ascii
-a93f52b7f565: Loading layer 3.174GB/3.174GB
-Loaded image: coreutils-genenetwork2:latest
-#+end_export
+To load the image interactively you've just created:
+
+: docker run -ti "python2-genenetwork2:latest" bash
Assuming you have a docker instance running, you could always run
commands in it e.g:
-: docker run "coreutils-genenetwork2:latest" python --version
-
+: docker run "python2-genenetwork2:latest" python --version
* Pushing to DockerHub