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 MAINTAINER Balint Varga <balint.varga@nokia.com>
19 ENV SWIFT_VERSION=$SWIFT
21 ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
23 COPY get-package build-pip common_scripts/wait-for-files /usr/bin/
24 COPY nginx.repo /etc/yum.repos.d/
26 RUN yum remove -y subscription-manager \
32 && mkdir -p ${GOPATH} \
33 && chmod 755 /usr/bin/build-pip /usr/bin/get-package /usr/bin/wait-for-files \
34 && echo "console" > /etc/securetty \
35 && chmod 400 /etc/shadow \
38 COPY supervisord.conf /etc/supervisord.conf
39 COPY mainstart.sh /usr/bin/mainstart.sh
40 COPY healthchecker.sh /usr/bin/healthchecker.sh
41 COPY source-list.txt ${GOPATH}/
43 RUN useradd -u 146 -s /sbin/nologin swift \
44 && mkdir -p /var/run/rsyncd \
45 && chown -R swift:swift /var/run/rsyncd \
46 && mkdir -p /var/lock/swift_locks \
47 && chown -R swift:swift /var/lock/swift_locks \
48 && mkdir -p /var/log/swift \
49 && chown -R swift:swift /var/log/swift \
50 && chmod 644 ${GOPATH}/source-list.txt \
51 && yum install -y --setopt=skip_missing_names_on_install=False \
67 # prepare nginx service
68 && touch /run/nginx.pid \
69 && chown -R swift:swift /var/lib/nginx /var/log/nginx /run/nginx.pid \
72 && mkdir ${GOPATH}/liberasurecode \
73 && cd ${GOPATH}/liberasurecode \
74 && get-package liberasurecode \
81 && mkdir ${GOPATH}/gf-complete \
82 && cd ${GOPATH}/gf-complete \
83 && get-package gf-complete \
84 && autoreconf --force --install \
90 && mkdir ${GOPATH}/Jerasure \
91 && cd ${GOPATH}/Jerasure \
92 && get-package Jerasure \
93 && autoreconf --force --install \
94 && ./configure LDFLAGS=-L${GOPATH}/other/gf-complete/src/.libs/ CPPFLAGS=-I${GOPATH}/other/gf-complete/include ax_cv_gcc_x86_cpuid_0x00000001=0 \
99 && mkdir ${GOPATH}/nasm \
100 && cd ${GOPATH}/nasm \
101 && get-package nasm \
107 && mkdir ${GOPATH}/isa-l \
108 && cd ${GOPATH}/isa-l \
109 && get-package isa-l \
116 && mkdir ${GOPATH}/setuptools \
117 && get-package python-setuptools \
118 && python bootstrap.py \
119 && python setup.py install \
122 # workaround, because the new chardet python package can't override the old one correctly
123 && curl -fsSL -k https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
124 && python get-pip.py \
125 && pip uninstall -y chardet \
127 # python dependencies
128 && build-pip python-enum-compat python-eventlet python-dnspython python-greenlet python-netifaces python-pastedeploy python-six \
129 python-pycparser python-cffi python-xattr \
130 python-idna python-enum34 python-ipaddress python-cryptography \
131 python-PyECLib python-supervisor python-supervisor-stdout \
132 python-lxml python-chardet python-requests \
135 && mkdir -p ${GOPATH}/pip \
136 && cd ${GOPATH}/pip \
137 && curl -fsSL -k https://tarballs.openstack.org/swift/swift-${SWIFT_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/pip/ \
138 && python setup.py install \
139 && rm -rf ${GOPATH}/pip/* \
141 # register the library path
142 && echo '/usr/local/lib' > /etc/ld.so.conf \
146 && chmod +x /usr/bin/mainstart.sh \
147 && mkdir -p /var/swift/recon \
148 && mkdir -p /var/cache/swift \
149 && mkdir /var/run/supervisor \
150 && chown -R swift /var/swift/recon \
151 && chown -R swift /var/cache/swift \
152 && chown -R swift /var/run/supervisor \
155 && yum --setopt=tsflags=noscripts remove -y gcc libffi-devel autoconf automake libtool python-devel openssl-devel \
157 && rm -rf /etc/yum.repos.d/luxembourg.repo \
158 && rm -rf ${GOPATH} \
159 && setcap 'cap_net_bind_service=+ep' /usr/bin/rsync
161 ENTRYPOINT ["/usr/bin/mainstart.sh"]