forked from humblec/gluster-containers
-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathDockerfile
104 lines (91 loc) · 4.71 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
FROM quay.io/centos/centos:stream9
MAINTAINER Humble Chirammal [email protected] Saravanakumar Arumugam [email protected]
ENV container docker
ENV ARCH "x86_64"
LABEL architecture="$ARCH" \
name="gluster/gluster-centos" \
version="latest" \
vendor="CentOS Community" \
summary="This image has a running glusterfs service (CentOS 7 + latest Gluster)" \
io.k8s.display-name="Gluster server based on CentOS 7" \
io.k8s.description="Gluster Image is based on CentOS Image which is a scalable network filesystem. Using common off-the-shelf hardware, you can create large, distributed storage solutions for media streaming, data analysis, and other data- and bandwidth-intensive tasks." \
description="Gluster Image is based on CentOS Image which is a scalable network filesystem. Using common off-the-shelf hardware, you can create large, distributed storage solutions for media streaming, data analysis, and other data- and bandwidth-intensive tasks." \
io.openshift.tags="gluster,glusterfs,glusterfs-centos"
RUN dnf --nodocs -y update && dnf --nodocs -y install centos-release-gluster && \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done) && \
rm -f /lib/systemd/system/multi-user.target.wants/* &&\
rm -f /etc/systemd/system/*.wants/* &&\
rm -f /lib/systemd/system/local-fs.target.wants/* && \
rm -f /lib/systemd/system/sockets.target.wants/*udev* && \
rm -f /lib/systemd/system/sockets.target.wants/*initctl* && \
rm -f /lib/systemd/system/basic.target.wants/* &&\
rm -f /lib/systemd/system/anaconda.target.wants/* &&\
dnf --nodocs -y install nfs-utils && \
dnf --nodocs -y install attr && \
dnf --nodocs -y install iputils && \
dnf --nodocs -y install iproute && \
dnf --nodocs -y install openssh-server && \
dnf --nodocs -y install openssh-clients && \
dnf --nodocs -y install rsync && \
dnf --nodocs -y install tar && \
dnf --nodocs -y install cronie && \
dnf --nodocs -y install xfsprogs && \
dnf --nodocs -y install glusterfs && \
dnf --nodocs -y install glusterfs-server && \
dnf --nodocs -y install glusterfs-rdma && \
dnf --nodocs -y install gluster-block && \
dnf --nodocs -y install glusterfs-geo-replication && dnf clean all && \
sed -i '/Port 22/c\Port 2222' /etc/ssh/sshd_config && \
sed -i 's/Requires\=rpcbind\.service//g' /usr/lib/systemd/system/glusterd.service && \
sed -i 's/rpcbind\.service/gluster-setup\.service/g' /usr/lib/systemd/system/glusterd.service && \
sed -i 's/rpcbind\.service//g' /usr/lib/systemd/system/gluster-blockd.service && \
mkdir -p /etc/glusterfs_bkp /var/lib/glusterd_bkp /var/log/glusterfs_bkp &&\
cp -r /etc/glusterfs/* /etc/glusterfs_bkp &&\
cp -r /var/lib/glusterd/* /var/lib/glusterd_bkp &&\
cp -r /var/log/glusterfs/* /var/log/glusterfs_bkp && \
mkdir -p /var/log/core;
# do not run udev (if needed, bind-mount /run/udev instead?)
RUN true \
&& systemctl mask systemd-udev-trigger.service \
&& systemctl mask systemd-udevd.service \
&& systemctl mask systemd-udevd.socket \
&& systemctl mask systemd-udevd-kernel.socket \
&& true
# use lvmetad from the host, dont run it in the container
# don't wait for udev to manage the /dev entries, disable udev_sync, udev_rules in lvm.conf
VOLUME [ "/run/lvm" ]
RUN true \
&& systemctl mask lvm2-lvmetad.service \
&& systemctl mask lvm2-lvmetad.socket \
&& sed -i 's/^\sudev_rules\s*=\s*1/udev_rules = 0/' /etc/lvm/lvm.conf \
&& sed -i 's/^\sudev_sync\s*=\s*1/udev_sync= 0/' /etc/lvm/lvm.conf \
&& sed -i 's/^\sobtain_device_list_from_udev\s*=\s*1/obtain_device_list_from_udev = 0/' /etc/lvm/lvm.conf \
&& true
# prevent dmeventd from running in the container, it may cause conflicts with
# the service running on the host
# monitoring of activated LVs can not be done inside the container
RUN true \
&& systemctl mask dm-event.service \
&& systemctl disable dm-event.socket \
&& systemctl mask dm-event.socket \
&& systemctl disable lvm2-monitor.service \
&& systemctl mask lvm2-monitor.service \
&& sed -i 's/^\smonitoring\s*=\s*1/monitoring = 0/' /etc/lvm/lvm.conf \
&& true
# mask services that aren't required in the container and/or might interfere
RUN true \
&& systemctl mask getty.target \
&& systemctl mask systemd-journal-flush.service \
&& systemctl mask rpcbind.socket \
&& true
VOLUME [ "/sys/fs/cgroup" ]
COPY . /tmp/container-setup
RUN true \
&& cd /tmp/container-setup \
&& ./setup-services.sh \
&& cd - \
&& rm -rf /tmp/container-setup \
&& true
EXPOSE 2222 111 245 443 24007 2049 8080 6010 6011 6012 38465 38466 38468 38469 49152 49153 49154 49156 49157 49158 49159 49160 49161 49162
ENTRYPOINT ["/usr/local/bin/update-params.sh"]
CMD ["/usr/sbin/init"]