This repository has been archived by the owner on May 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
116 lines (105 loc) · 5.95 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
FROM alpine:3.9.3
LABEL maintainer="'Art Eschenlauer, [email protected]'"
################################### Accounts and Groups ####################################
# Add required galaxy and postgres accounts
RUN sed -i -e 's/^postgres:x:[^:]*:[^:]*:/postgres:x:999:999:/' /etc/passwd
RUN sed -i -e 's/^postgres:x:[^:]*:/postgres:x:999:/' /etc/group
RUN adduser -s /bin/bash -h /export -D -H -u 1450 -g "Galaxy-file owner" galaxy
###################################### Python Basis ########################################
# Base python for the image as Python3
RUN apk add python3
# prevent "pip not found" error and suppress warning about outdated pip, if any
RUN pip3 install --upgrade pip
######################################## Packages ##########################################
# The coreutils binary adds a megabyte to the image size,
# but it gives some required invocation options for 'date'
RUN apk add coreutils
# Including bash (required), curl (handy)
RUN apk add bash curl
# Support scheduled activity, e.g., daily backups
RUN apk add dcron
# Support documentation in the unix-manual format
RUN apk add man && bash -c 'for i in {1..8}; do mkdir -p /usr/local/man/man${i}; done'
# To get all of the standard man pages themselves, you could uncomment the next line,
# but note that it nearly doubles the size of the image.
#RUN apk add man-pages
# Support the vim editor
RUN apk add vim
# Include s3cmd for transmitting files to Amazon-S3 compatible buckets. See e.g.:
# https://en.wikipedia.org/wiki/Amazon_S3#S3_API_and_competing_services
RUN pip install s3cmd
#################################### Large Binaries #######################################
# Substitute statically linked busybox so that it can be shared with glibc-based containers
# See https://github.com/eschen42/alpine-cbuilder#statically-linked-busybox
# and https://github.com/HegemanLab/galaxy-tardis/releases/tag/binary1-pre
RUN mkdir -p /opt/support && \
cd /opt/support && \
wget https://github.com/HegemanLab/galaxy-tardis/releases/download/binary1-pre/busybox-static.gz --output-document busybox.gz && \
gzip -d busybox.gz && \
chmod +x busybox
RUN ln -f /opt/support/busybox /bin/busybox
# The coreutils binary adds a megabyte to the image size,
# but it gives some required invocation options for 'date'
RUN apk add coreutils
# Including bash (required), curl (handy)
RUN apk add bash curl
# Include s3cmd for transmitting files to Amazon-S3 compatible buckets. See e.g.:
# https://en.wikipedia.org/wiki/Amazon_S3#S3_API_and_competing_services
RUN apk add py-pip && pip install s3cmd
# Support scheduled activity, e.g., daily backups
RUN apk add dcron
# Add statically linked docker binary
# See https://github.com/rootless-containers/usernetes/releases/tag/v20190212.0
# and https://github.com/HegemanLab/galaxy-tardis/releases/tag/binary1-pre
RUN mkdir -p /usr/local/bin && \
cd /usr/local/bin && \
wget https://github.com/HegemanLab/galaxy-tardis/releases/download/binary1-pre/docker-usernetes.gz --output-document docker.gz && \
gzip -d docker.gz && \
chmod +x docker && \
cd ..
# Add statically linked cvs binary so that it can be shared with glibc-based containers
# See https://github.com/eschen42/alpine-cbuilder#cvs-executable-independent-of-glibc
# and https://github.com/HegemanLab/galaxy-tardis/releases/tag/binary1-pre
RUN cd /opt/support && \
wget https://github.com/HegemanLab/galaxy-tardis/releases/download/binary1-pre/cvs-static.gz --output-document cvs.gz && \
gzip -d cvs.gz && \
chmod +x cvs
RUN ln /opt/support/cvs /usr/local/bin/cvs
######################################## Scripts ##########################################
# Support file, configuration, and database backup and restore with S3-compatible block storage
COPY s3/live_file_backup.sh /opt/s3/live_file_backup.sh
COPY s3/live_file_restore.sh /opt/s3/live_file_restore.sh
COPY s3/bucket_backup.sh /opt/s3/bucket_backup.sh
COPY s3/bucket_retrieve.sh /opt/s3/bucket_retrieve.sh
# S3-independent scripts to support backup and restore
COPY support/transmit_backup.sh /opt/support/transmit_backup.sh
COPY support/retrieve_backup.sh /opt/support/retrieve_backup.sh
# Dump galaxy configuration files and downloaded shed tools
COPY support/config_xml_dump.sh /opt/support/config_xml_dump.sh
COPY support/pgadmin_dump.sh /opt/support/pgadmin_dump.sh
# Load galaxy configuration files and downloaded shed tools
COPY support/config_seed.sh /opt/support/config_seed.sh
# Upgrade miniconda as needed
COPY support/conda_upgrade.sh /opt/support/conda_upgrade.sh
# Dump and load PostgreSQL database
COPY support/db_dump.sh /opt/support/db_dump.sh
COPY support/db_seed.sh /opt/support/db_seed.sh
# Core executable for the TARDIS container
COPY support/tardis /opt/support/tardis
COPY support/tardis_setup /opt/support/tardis_setup
# Daily backup cron task
COPY support/backup.crontab /opt/support/backup.crontab
COPY support/cron.sh /opt/support/cron.sh
# Entrypoint executable
COPY init /opt/init
####################################### Permissions ######################################
# Executable-file permissions (besides busybox and cvs because they are hard-linked)
RUN chmod +x /opt/init
RUN chmod +x /opt/s3/*.sh
RUN chmod +x /opt/support/*.sh
RUN chmod +x /opt/support/tardis
####################################### Wrapping Up ######################################
# Set the entry point
ENTRYPOINT ["/opt/init"]
# Provide intra-container copy of this container-definition
COPY Dockerfile /opt/support/Dockerfile