1
1
FROM centos:7
2
2
3
3
ARG BUILD_NUMBER
4
+ ARG BUILD_ARCH='x64'
4
5
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
6
7
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}
9
12
10
13
ARG PYTHON_VERSION="2.7.8"
14
+ ARG CMAKE_ARCH='x86_64'
11
15
ARG CMAKE_VERSION="3.20"
12
16
ARG CMAKE_0VERSION="3.20.0"
13
17
ARG GRPC_VERSION="1.36.4"
@@ -26,6 +30,7 @@ ARG AUTOMAKE_VERSION="1.16.3"
26
30
ARG PERL_VERSION="5.20.2"
27
31
ARG PERL_CPANVERSION="5.0"
28
32
ARG PCRE_VERSION="8.44"
33
+ ARG NGINX_ARCH='x86_64'
29
34
ARG NGINX_VERSION="1.24.0"
30
35
31
36
# create default non-root user
@@ -76,12 +81,12 @@ RUN wget http://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERS
76
81
# install gosu for easy step-down from root (from https://github.com/tianon/gosu/blob/master/INSTALL.md#from-centos)
77
82
ENV GOSU_VERSION=1.10
78
83
# 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" \
81
86
# && gpg --verify /usr/bin/gosu.asc \
82
87
# && rm /usr/bin/gosu.asc \
83
88
# && 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} " \
85
90
&& chmod +x /usr/bin/gosu \
86
91
# Verify that the binary works
87
92
&& gosu nobody true
@@ -91,11 +96,11 @@ RUN yum install git -y \
91
96
&& yum clean all
92
97
93
98
# 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} \
97
102
&& 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
99
104
100
105
# install grpc. If planning to upgrade, make sure sed command works
101
106
RUN git clone https://github.com/grpc/grpc \
@@ -273,13 +278,13 @@ RUN cp -r /dependencies /otel-webserver-module/ \
273
278
274
279
RUN echo '[nginx]' >> /etc/yum.repos.d/nginx.repo \
275
280
&& 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 \
277
282
&& echo 'gpgcheck=0' >> /etc/yum.repos.d/nginx.repo \
278
283
&& echo 'enabled=1' >> /etc/yum.repos.d/nginx.repo \
279
284
&& yum install nginx-${NGINX_VERSION} -y
280
285
281
286
RUN cd /otel-webserver-module/build \
282
- && tar -xf opentelemetry-webserver-sdk-x64 -linux.tgz \
287
+ && tar -xf opentelemetry-webserver-sdk-${BUILD_ARCH} -linux.tgz \
283
288
&& mv -f opentelemetry-webserver-sdk /opt/ \
284
289
&& cd ../ \
285
290
&& cp opentelemetry_module.conf /etc/httpd/conf/ \
@@ -295,7 +300,7 @@ RUN cp /otel-webserver-module/conf/nginx/opentelemetry_module.conf /opt/ \
295
300
&& cd /
296
301
297
302
# 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} \
299
304
&& rm -rf libtool-${LIBTOOL_VERSION} && rm -rf Python-${PYTHON_VERSION} \
300
305
&& rm -f apr-${APR_VERSION}.tar.gz && rm -f apr-util-${APRUTIL_VERSION}.tar.gz \
301
306
&& rm -f httpd-2.2.31.tar.gz && rm -f httpd-2.4.23.tar.gz
0 commit comments