11FROM centos:7
22
33ARG BUILD_NUMBER
4+ ARG BUILD_ARCH='x64'
45
5- LABEL NAME=apm/build-image-webserver-agent-centos6-x64 VERSION=$BUILD_NUMBER
6+ LABEL NAME=apm/build-image-webserver-agent-centos6-${BUILD_ARCH} VERSION=$BUILD_NUMBER
67
7- ENV GOSU_ARCH amd64
8- ENV JDK_ARCH x64
8+ ARG GOSU_ARCH='amd64'
9+ ENV GOSU_ARCH=${GOSU_ARCH}
10+ ARG JDK_ARCH='x64'
11+ ENV JDK_ARCH=${JDK_ARCH}
912
1013ARG PYTHON_VERSION="2.7.8"
14+ ARG CMAKE_ARCH='x86_64'
1115ARG CMAKE_VERSION="3.20"
1216ARG CMAKE_0VERSION="3.20.0"
1317ARG GRPC_VERSION="1.36.4"
@@ -26,6 +30,7 @@ ARG AUTOMAKE_VERSION="1.16.3"
2630ARG PERL_VERSION="5.20.2"
2731ARG PERL_CPANVERSION="5.0"
2832ARG PCRE_VERSION="8.44"
33+ ARG NGINX_ARCH='x86_64'
2934ARG NGINX_VERSION="1.24.0"
3035
3136# create default non-root user
@@ -76,12 +81,12 @@ RUN wget http://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERS
7681# install gosu for easy step-down from root (from https://github.com/tianon/gosu/blob/master/INSTALL.md#from-centos)
7782ENV GOSU_VERSION=1.10
7883# RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
79- # && curl -o /usr/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64 " \
80- # && curl -o /usr/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64 .asc" \
84+ # && curl -o /usr/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH} " \
85+ # && curl -o /usr/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH} .asc" \
8186# && gpg --verify /usr/bin/gosu.asc \
8287# && rm /usr/bin/gosu.asc \
8388# && rm -r /root/.gnupg/ \
84- RUN curl -o /usr/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64 " \
89+ RUN curl -o /usr/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH} " \
8590 && chmod +x /usr/bin/gosu \
8691 # Verify that the binary works
8792 && gosu nobody true
@@ -91,11 +96,11 @@ RUN yum install git -y \
9196 && yum clean all
9297
9398# install cmake 3.20
94- RUN wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_0VERSION}-linux-x86_64 .tar.gz \
95- && tar -xvf cmake-${CMAKE_0VERSION}-linux-x86_64 .tar.gz \
96- && cd cmake-${CMAKE_0VERSION}-linux-x86_64 \
99+ RUN wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_0VERSION}-linux-${CMAKE_ARCH} .tar.gz \
100+ && tar -xvf cmake-${CMAKE_0VERSION}-linux-${CMAKE_ARCH} .tar.gz \
101+ && cd cmake-${CMAKE_0VERSION}-linux-${CMAKE_ARCH} \
97102 && cp -rf * /usr/local/ \
98- && cd .. && rm -rf cmake-${CMAKE_0VERSION}-linux-x86_64 .tar.gz
103+ && cd .. && rm -rf cmake-${CMAKE_0VERSION}-linux-${CMAKE_ARCH} .tar.gz
99104
100105# install grpc. If planning to upgrade, make sure sed command works
101106RUN git clone https://github.com/grpc/grpc \
@@ -273,13 +278,13 @@ RUN cp -r /dependencies /otel-webserver-module/ \
273278
274279RUN echo '[nginx]' >> /etc/yum.repos.d/nginx.repo \
275280 && echo 'name=nginx repo' >> /etc/yum.repos.d/nginx.repo \
276- && echo ' baseurl=https://nginx.org/packages/centos/7/x86_64' >> /etc/yum.repos.d/nginx.repo \
281+ && echo " baseurl=https://nginx.org/packages/centos/7/${NGINX_ARCH}" >> /etc/yum.repos.d/nginx.repo \
277282 && echo 'gpgcheck=0' >> /etc/yum.repos.d/nginx.repo \
278283 && echo 'enabled=1' >> /etc/yum.repos.d/nginx.repo \
279284 && yum install nginx-${NGINX_VERSION} -y
280285
281286RUN cd /otel-webserver-module/build \
282- && tar -xf opentelemetry-webserver-sdk-x64 -linux.tgz \
287+ && tar -xf opentelemetry-webserver-sdk-${BUILD_ARCH} -linux.tgz \
283288 && mv -f opentelemetry-webserver-sdk /opt/ \
284289 && cd ../ \
285290 && cp opentelemetry_module.conf /etc/httpd/conf/ \
@@ -295,7 +300,7 @@ RUN cp /otel-webserver-module/conf/nginx/opentelemetry_module.conf /opt/ \
295300 && cd /
296301
297302# Remove unwanted files
298- RUN rm -rf grpc && rm -rf autoconf-${AUTOCONF_VERSION} && rm -rf automake-${AUTOMAKE_VERSION} && rm -rf cmake-${CMAKE_VERSION}-linux-x86_64 \
303+ RUN rm -rf grpc && rm -rf autoconf-${AUTOCONF_VERSION} && rm -rf automake-${AUTOMAKE_VERSION} && rm -rf cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH} \
299304 && rm -rf libtool-${LIBTOOL_VERSION} && rm -rf Python-${PYTHON_VERSION} \
300305 && rm -f apr-${APR_VERSION}.tar.gz && rm -f apr-util-${APRUTIL_VERSION}.tar.gz \
301306 && rm -f httpd-2.2.31.tar.gz && rm -f httpd-2.4.23.tar.gz
0 commit comments