-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
72 lines (59 loc) · 2.97 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
#name of container: docker-koha
#versison of container: 0.1.1
FROM quantumobject/docker-baseimage
MAINTAINER Angel Rodriguez "angel@quantumobject.com"
#add repository and update the container
#Installation of nesesary package/software for this containers...
RUN echo deb http://debian.koha-community.org/koha squeeze-dev main | sudo tee /etc/apt/sources.list.d/koha.list
RUN wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
RUN echo "deb http://archive.ubuntu.com/ubuntu utopic-backports main restricted " >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y -q apache2 \
mysql-server \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/* \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && a2dismod mpm_event && a2enmod mpm_prefork && apt-get install -f -y -q libapache2-mpm-itk \
koha-common \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/* \
&& rm -rf /var/lib/apt/lists/*
##startup script
#Pre-config scrip that maybe need to be run one time only when the container run the first time .. using a flag to don't
#run it again ... use for conf for service ... when run the first time ...
RUN mkdir -p /etc/my_init.d
COPY startup.sh /etc/my_init.d/startup.sh
RUN chmod +x /etc/my_init.d/startup.sh
##Adding Deamons to containers
# to add mysqld deamon to runit
RUN mkdir /etc/service/mysqld
COPY mysqld.sh /etc/service/mysqld/run
RUN chmod +x /etc/service/mysqld/run
# to add apache2 deamon to runit
RUN mkdir /etc/service/apache2
COPY apache2.sh /etc/service/apache2/run
RUN chmod +x /etc/service/apache2/run
# to add zebra deamon to runit
RUN mkdir /etc/service/zebra
COPY zebra.sh /etc/service/zebra/run
RUN chmod +x /etc/service/zebra/run
#pre-config scritp for different service that need to be run when container image is create
#maybe include additional software that need to be installed ... with some service running ... like example mysqld
COPY pre-conf.sh /sbin/pre-conf
RUN chmod +x /sbin/pre-conf \
&& /bin/bash -c /sbin/pre-conf \
&& rm /sbin/pre-conf
#down/shutdown script ... use to be run in container before stop or shutdown .to keep service..good status..and maybe
#backup or keep data integrity ..
##scritp that can be running from the outside using docker-bash tool ...
## for example to create backup for database with convitation of VOLUME dockers-bash container_ID backup_mysql
COPY backup.sh /sbin/backup
RUN chmod +x /sbin/backup
VOLUME /var/backups
#script to execute after install configuration done ....
COPY after_install.sh /sbin/after_install
RUN chmod +x /sbin/after_install
# to allow access from outside of the container to the container service
# at that ports need to allow access from firewall if need to access it outside of the server.
EXPOSE 8080 80
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]