Skip to content

Commit 6e61253

Browse files
committed
ansible: add Ubuntu 22.04 sharedlibs container
Add an Ubuntu 22.04 based sharedlibs container, intended to eventually replace the Ubuntu 18.04 based one. Changes compared to the Ubuntu 18.04 container: - Add FIPS variant for OpenSSL 3.0. - Add OpenSSL 3.1. - Dropped older versions of ICU that were used for Node.js 14.
1 parent 5972cc4 commit 6e61253

File tree

1 file changed

+136
-0
lines changed

1 file changed

+136
-0
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
FROM ubuntu:22.04
2+
3+
ENV LC_ALL C
4+
ENV USER {{ server_user }}
5+
ENV JOBS {{ server_jobs | default(ansible_processor_vcpus) }}
6+
ENV SHELL /bin/bash
7+
ENV HOME /home/{{ server_user }}
8+
ENV PATH /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9+
ENV NODE_COMMON_PIPE /home/{{ server_user }}/test.pipe
10+
ENV NODE_TEST_DIR /home/{{ server_user }}/tmp
11+
ENV OSTYPE linux-gnu
12+
ENV OSVARIANT docker
13+
ENV DESTCPU {{ arch }}
14+
ENV ARCH {{ arch }}
15+
ENV DEBIAN_FRONTEND noninteractive
16+
17+
RUN apt-get update && apt-get install apt-utils -y && \
18+
apt-get dist-upgrade -y && apt-get install -y \
19+
ccache \
20+
g++ \
21+
gcc \
22+
git \
23+
openjdk-17-jre-headless \
24+
pkg-config \
25+
curl \
26+
python3-pip \
27+
python-is-python3 \
28+
libfontconfig1 \
29+
libtool \
30+
automake
31+
32+
RUN pip3 install tap2junit=={{ tap2junit_version }}
33+
34+
RUN addgroup --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }}
35+
36+
RUN adduser --gid {{ server_user_gid.stdout_lines[0] }} --uid {{ server_user_uid.stdout_lines[0] }} --disabled-password --gecos {{ server_user }} {{ server_user }}
37+
38+
ENV ICU68DIR=/opt/icu-68.1 \
39+
ICU69DIR=/opt/icu-69.1 \
40+
ICU71DIR=/opt/icu-71.1
41+
42+
RUN for ICU_ENV in $(env | grep ICU..DIR); do \
43+
ICU_PREFIX=$(echo $ICU_ENV | cut -d '=' -f 2) && \
44+
ICU_VERSION=$(echo $ICU_PREFIX | cut -d '-' -f 2) && \
45+
ICU_MAJOR=$(echo $ICU_VERSION | cut -d '.' -f 1) && \
46+
ICU_MINOR=$(echo $ICU_VERSION | cut -d '.' -f 2) && \
47+
mkdir -p /tmp/icu-$ICU_VERSION && \
48+
cd /tmp/icu-$ICU_VERSION && \
49+
curl -sL "https://github.com/unicode-org/icu/releases/download/release-$ICU_MAJOR-$ICU_MINOR/icu4c-${ICU_MAJOR}_$ICU_MINOR-src.tgz" | tar zxv --strip=1 && \
50+
cd source && \
51+
./runConfigureICU Linux --prefix=$ICU_PREFIX && \
52+
make -j $JOBS && \
53+
make install && \
54+
rm -rf /tmp/icu-$ICU_VERSION; \
55+
done
56+
57+
ENV OPENSSL111VER 1.1.1u
58+
ENV OPENSSL111DIR /opt/openssl-$OPENSSL111VER
59+
60+
RUN mkdir -p /tmp/openssl_$OPENSSL111VER && \
61+
cd /tmp/openssl_$OPENSSL111VER && \
62+
curl -sL https://www.openssl.org/source/openssl-$OPENSSL111VER.tar.gz | tar zxv --strip=1 && \
63+
./config --prefix=$OPENSSL111DIR && \
64+
make -j $JOBS && \
65+
make install && \
66+
rm -rf /tmp/openssl_$OPENSSL111VER
67+
68+
# OpenSSL FIPS validation occurs post-release, and not for every version.
69+
# See https://www.openssl.org/docs/fips.html and the version documented in the
70+
# certificate and security policy.
71+
ENV OPENSSL30FIPSVER 3.0.8
72+
ENV OPENSSL30FIPSDIR /opt/openssl-$OPENSSL30FIPSVER-fips
73+
74+
RUN mkdir -p /tmp/openssl-$OPENSSL30FIPSVER && \
75+
cd /tmp/openssl-$OPENSSL30FIPSVER && \
76+
curl -sL https://www.openssl.org/source/openssl-$OPENSSL30FIPSVER.tar.gz | tar zxv --strip=1 && \
77+
./config --prefix=$OPENSSL30FIPSDIR enable-fips && \
78+
make -j $JOBS && \
79+
make install && \
80+
rm -rf /tmp/openssl-$OPENSSL30FIPSVER
81+
# Install the FIPS provider. Update OpenSSL config file to enable FIPS.
82+
RUN LD_LIBRARY_PATH=$OPENSSL30FIPSDIR/lib64 $OPENSSL30FIPSDIR/bin/openssl fipsinstall \
83+
-module $OPENSSL30FIPSDIR/lib64/ossl-modules/fips.so -provider_name fips \
84+
-out $OPENSSL30FIPSDIR/ssl/fipsmodule.cnf && \
85+
sed -i -r "s|^# (.include fipsmodule.cnf)|.include $OPENSSL30FIPSDIR\/ssl\/fipsmodule.cnf|g" $OPENSSL30FIPSDIR/ssl/openssl.cnf && \
86+
sed -i -r '/^providers = provider_sect/a alg_section = evp_properties' $OPENSSL30FIPSDIR/ssl/openssl.cnf && \
87+
sed -i -r 's/^# (fips = fips_sect)/\1/g' $OPENSSL30FIPSDIR/ssl/openssl.cnf && \
88+
sed -i -r 's/^# (activate = 1)/\1/g' $OPENSSL30FIPSDIR/ssl/openssl.cnf && \
89+
echo "\n[evp_properties]\ndefault_properties = \"fips=yes\"\n" >> $OPENSSL30FIPSDIR/ssl/openssl.cnf
90+
91+
ENV OPENSSL30VER 3.0.8+quic
92+
ENV OPENSSL30DIR /opt/openssl-$OPENSSL30VER
93+
94+
RUN mkdir -p /tmp/openssl-$OPENSSL30VER && \
95+
cd /tmp/openssl-$OPENSSL30VER && \
96+
git clone https://github.com/quictls/openssl.git -b openssl-$OPENSSL30VER --depth 1 && \
97+
cd openssl && \
98+
./config --prefix=$OPENSSL30DIR && \
99+
make -j $JOBS && \
100+
make install && \
101+
rm -rf /tmp/openssl-$OPENSSL30VER
102+
103+
ENV OPENSSL31VER 3.1.1
104+
ENV OPENSSL31DIR /opt/openssl-$OPENSSL31VER
105+
106+
RUN mkdir -p /tmp/openssl-$OPENSSL31VER && \
107+
cd /tmp/openssl-$OPENSSL31VER && \
108+
curl -sL https://www.openssl.org/source/openssl-$OPENSSL31VER.tar.gz | tar zxv --strip=1 && \
109+
./config --prefix=$OPENSSL31DIR && \
110+
make -j $JOBS && \
111+
make install && \
112+
rm -rf /tmp/openssl-$OPENSSL31VER
113+
114+
ENV ZLIBVER 1.2.13
115+
ENV ZLIB12DIR /opt/zlib_$ZLIBVER
116+
117+
RUN mkdir -p /tmp/zlib_$ZLIBVER && \
118+
cd /tmp/zlib_$ZLIBVER && \
119+
curl -sL https://zlib.net/fossils/zlib-$ZLIBVER.tar.gz | tar zxv --strip=1 && \
120+
./configure --prefix=$ZLIB12DIR && \
121+
make -j $JOBS && \
122+
make install && \
123+
rm -rf /tmp/zlib_$ZLIBVER
124+
125+
VOLUME /home/{{ server_user }}/ /home/{{ server_user }}/.ccache
126+
127+
USER iojs:iojs
128+
129+
ENV CCACHE_TEMPDIR /home/iojs/.ccache/{{ item.name }}
130+
131+
CMD cd /home/iojs \
132+
&& curl https://ci.nodejs.org/jnlpJars/agent.jar -O \
133+
&& java -Xmx{{ server_ram|default('128m') }} \
134+
-jar /home/{{ server_user }}/agent.jar \
135+
-jnlpUrl {{ jenkins_url }}/computer/{{ item.name }}/jenkins-agent.jnlp \
136+
-secret {{ item.secret }}

0 commit comments

Comments
 (0)