Skip to content

Commit 77661e7

Browse files
authored
Update the CentOS devcontainer (#15615)
Motivation: After QUIC was added, we've needed a few more things in the environment to compile BoringSSL, Rust code, Quiche, etc. Modification: Update the CentOS devcontainer docker image to match the image we use for PR builds. Result: The CentOS devcontainer can now build Netty again.
1 parent ea90268 commit 77661e7

1 file changed

Lines changed: 43 additions & 4 deletions

File tree

.devcontainer/centos7/Dockerfile

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,55 @@
1-
FROM --platform=linux/amd64 centos:7.6.1810
1+
FROM --platform=linux/amd64 centos:7.9.2009
2+
3+
ENV SOURCE_DIR=/root/source
4+
ENV LIBS_DIR=/root/libs
5+
ENV CMAKE_VERSION_BASE=3.26
6+
ENV CMAKE_VERSION=$CMAKE_VERSION_BASE.4
7+
ENV NINJA_VERSION=1.7.2
8+
ENV GO_VERSION=1.9.3
29

310
# Update as we need to use the vault now.
4-
RUN sed -i -e 's/^mirrorlist/#mirrorlist/g' -e 's/^#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\//baseurl=https:\/\/linuxsoft.cern.ch\/centos-vault\/\/7.6.1810\//g' /etc/yum.repos.d/CentOS-Base.repo
11+
RUN sed -i -e 's/^mirrorlist/#mirrorlist/g' -e 's/^#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\//baseurl=https:\/\/linuxsoft.cern.ch\/centos-vault\/\/7.9.2009\//g' /etc/yum.repos.d/CentOS-Base.repo
512

613
# install dependencies
714
RUN yum install -y \
815
apr-devel \
916
autoconf \
1017
automake \
18+
bzip2 \
1119
git \
1220
glibc-devel \
21+
gnupg \
22+
java-1.8.0-openjdk-devel \
1323
libtool \
1424
lksctp-tools \
1525
lsb-core \
1626
make \
1727
openssl-devel \
28+
perl \
1829
tar \
1930
unzip \
2031
wget \
21-
zip
32+
zip \
33+
zlib-devel
34+
35+
RUN mkdir $SOURCE_DIR
36+
WORKDIR $SOURCE_DIR
37+
38+
RUN yum install -y centos-release-scl
39+
40+
# Update to use the vault
41+
RUN sed -i -e 's/^mirrorlist/#mirrorlist/g' -e 's/^# baseurl=http:\/\/mirror.centos.org\/centos\/7\/sclo\/$basearch\/sclo\//baseurl=https:\/\/vault.centos.org\/centos\/7\/sclo\/$basearch\/sclo\//g' /etc/yum.repos.d/CentOS-SCLo-scl.repo
42+
RUN sed -i -e 's/^mirrorlist/#mirrorlist/g' -e 's/^#baseurl=http:\/\/mirror.centos.org\/centos\/7\/sclo\/$basearch\/rh\//baseurl=https:\/\/vault.centos.org\/centos\/7\/sclo\/$basearch\/rh\//g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
2243

44+
RUN yum -y install devtoolset-11-gcc devtoolset-11-gcc-c++
45+
RUN echo 'source /opt/rh/devtoolset-11/enable' >> ~/.bashrc
46+
47+
RUN echo "export CMAKE_VERSION='$CMAKE_VERSION'" >> ~/.bashrc
48+
RUN echo "export NINJA_VERSION='$NINJA_VERSION'" >> ~/.bashrc
49+
RUN echo "export GO_VERSION='$GO_VERSION'" >> ~/.bashrc
50+
RUN wget -q https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-linux.zip && unzip ninja-linux.zip && mkdir -p /opt/ninja-$NINJA_VERSION/bin && mv ninja /opt/ninja-$NINJA_VERSION/bin && echo 'PATH=/opt/ninja-$NINJA_VERSION/bin:$PATH' >> ~/.bashrc
51+
RUN wget -q https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz && tar zxf go$GO_VERSION.linux-amd64.tar.gz && mv go /opt/ && echo 'PATH=/opt/go/bin:$PATH' >> ~/.bashrc && echo 'export GOROOT=/opt/go/' >> ~/.bashrc
52+
RUN curl -s https://cmake.org/files/v$CMAKE_VERSION_BASE/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz --output cmake-$CMAKE_VERSION-linux-x86_64.tar.gz && tar zxf cmake-$CMAKE_VERSION-linux-x86_64.tar.gz && mv cmake-$CMAKE_VERSION-linux-x86_64 /opt/ && echo 'PATH=/opt/cmake-$CMAKE_VERSION-linux-x86_64/bin:$PATH' >> ~/.bashrc
2353

2454
# Downloading and installing SDKMAN!
2555
RUN curl -s "https://get.sdkman.io?ci=true" | bash
@@ -34,9 +64,18 @@ RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \
3464
rm -rf $HOME/.sdkman/tmp/*"
3565

3666
RUN echo 'export JAVA_HOME="/root/.sdkman/candidates/java/current"' >> ~/.bashrc
37-
RUN echo 'PATH=/jdk/bin:$PATH' >> ~/.bashrc
67+
RUN echo 'PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc
68+
69+
# install rust and setup PATH
70+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
71+
RUN echo 'PATH=$PATH:$HOME/.cargo/bin' >> ~/.bashrc
72+
73+
# Prepare our own build
74+
ENV PATH=/root/.sdkman/candidates/maven/current:$PATH
75+
ENV JAVA_HOME=/root/.sdkman/candidates/java/current
3876

3977
# Cleanup
78+
RUN rm -rf $SOURCE_DIR
4079
RUN yum clean all && \
4180
rm -rf /var/cache/yum
4281

0 commit comments

Comments
 (0)