3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 ADD centos-7-docker.tar.xz /
18 MAINTAINER Balint Varga <balint.varga@nokia.com>
21 ENV SWIFT_VERSION=$SWIFT
23 ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
25 COPY get-package build-pip common_scripts/wait-for-files /usr/bin/
26 COPY nginx.repo /etc/yum.repos.d/
28 RUN yum remove -y subscription-manager \
34 && mkdir -p ${GOPATH} \
35 && chmod 755 /usr/bin/build-pip /usr/bin/get-package /usr/bin/wait-for-files \
36 && echo "console" > /etc/securetty \
37 && chmod 400 /etc/shadow \
40 COPY supervisord.conf /etc/supervisord.conf
41 COPY mainstart.sh /usr/bin/mainstart.sh
42 COPY healthchecker.sh /usr/bin/healthchecker.sh
43 COPY source-list.txt ${GOPATH}/
45 RUN useradd -u 146 -s /sbin/nologin swift \
46 && mkdir -p /var/run/rsyncd \
47 && chown -R swift:swift /var/run/rsyncd \
48 && mkdir -p /var/lock/swift_locks \
49 && chown -R swift:swift /var/lock/swift_locks \
50 && mkdir -p /var/log/swift \
51 && chown -R swift:swift /var/log/swift \
52 && chmod 644 ${GOPATH}/source-list.txt \
53 && yum install -y --setopt=skip_missing_names_on_install=False \
69 # prepare nginx service
70 && touch /run/nginx.pid \
71 && chown -R swift:swift /var/lib/nginx /var/log/nginx /run/nginx.pid \
74 && mkdir ${GOPATH}/liberasurecode \
75 && cd ${GOPATH}/liberasurecode \
76 && get-package liberasurecode \
83 && mkdir ${GOPATH}/gf-complete \
84 && cd ${GOPATH}/gf-complete \
85 && get-package gf-complete \
86 && autoreconf --force --install \
92 && mkdir ${GOPATH}/Jerasure \
93 && cd ${GOPATH}/Jerasure \
94 && get-package Jerasure \
95 && autoreconf --force --install \
96 && ./configure LDFLAGS=-L${GOPATH}/other/gf-complete/src/.libs/ CPPFLAGS=-I${GOPATH}/other/gf-complete/include ax_cv_gcc_x86_cpuid_0x00000001=0 \
101 && mkdir ${GOPATH}/nasm \
102 && cd ${GOPATH}/nasm \
103 && get-package nasm \
109 && mkdir ${GOPATH}/isa-l \
110 && cd ${GOPATH}/isa-l \
111 && get-package isa-l \
118 && mkdir ${GOPATH}/setuptools \
119 && get-package python-setuptools \
120 && python bootstrap.py \
121 && python setup.py install \
124 # workaround, because the new chardet python package can't override the old one correctly
125 && curl -fsSL -k https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
126 && python get-pip.py \
127 && pip uninstall -y chardet \
129 # python dependencies
130 && build-pip python-enum-compat python-eventlet python-dnspython python-greenlet python-netifaces python-pastedeploy python-six \
131 python-pycparser python-cffi python-xattr \
132 python-idna python-enum34 python-ipaddress python-cryptography \
133 python-PyECLib python-supervisor python-supervisor-stdout \
134 python-lxml python-chardet python-requests \
137 && mkdir -p ${GOPATH}/pip \
138 && cd ${GOPATH}/pip \
139 && curl -fsSL -k https://tarballs.openstack.org/swift/swift-${SWIFT_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/pip/ \
140 && python setup.py install \
141 && rm -rf ${GOPATH}/pip/* \
143 # register the library path
144 && echo '/usr/local/lib' > /etc/ld.so.conf \
148 && chmod +x /usr/bin/mainstart.sh \
149 && mkdir -p /var/swift/recon \
150 && mkdir -p /var/cache/swift \
151 && mkdir /var/run/supervisor \
152 && chown -R swift /var/swift/recon \
153 && chown -R swift /var/cache/swift \
154 && chown -R swift /var/run/supervisor \
157 && yum --setopt=tsflags=noscripts remove -y gcc libffi-devel autoconf automake libtool python-devel openssl-devel \
159 && rm -rf /etc/yum.repos.d/luxembourg.repo \
160 && rm -rf ${GOPATH} \
161 && setcap 'cap_setgid,cap_setuid,cap_net_bind_service=+ep' /usr/bin/rsync
163 ENTRYPOINT ["/usr/bin/mainstart.sh"]