forked from jspaleta/sensu-python-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.centos6
More file actions
37 lines (29 loc) · 1.53 KB
/
Copy pathDockerfile.centos6
File metadata and controls
37 lines (29 loc) · 1.53 KB
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
FROM siva9427/centos6-python-3.6.12:latest
LABEL name="sensu/sensu-python-runtime-centos6"
ARG PYTHON_VERSION=3.8.5
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'
# https://arstech.net/centos-6-error-yumrepo-error-all-mirror-urls-are-not-using-ftp-http/
RUN cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.old
COPY centos-base.repo /etc/yum.repos.d/CentOS-Base.repo
RUN yum clean all
RUN yum -y update
RUN yum -y groupinstall "Development Tools"
RUN yum -y install curl
RUN yum -y install bzip2-devel
RUN yum -y install zlib-devel
RUN yum -y install sqlite-devel
RUN yum -y install openssl-devel
RUN yum -y install readline-devel
RUN yum -y install libffi-devel
RUN yum -y install wget
RUN yum -y install gcc
COPY scripts/pyenv-install pyenv-install
COPY requirements.txt requirements.txt
RUN ./pyenv-install
RUN LIBS=$(find /build/pyenv -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /build/lib/; fi; done
RUN mkdir /assets/ && \
export SENSU_ASSET="/assets/sensu-python-runtime_${ASSET_VERSION}_python-${PYTHON_VERSION}_centos6_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
tar -czf $SENSU_ASSET -C /build/ .
ENV PATH=$PATH:/build/bin