Skip to content

Commit 06c6820

Browse files
Merge pull request #85 from yudong2015/v4.1.3-dev
replace base image centos7 by ubuntu:22.04
2 parents db30007 + 950115b commit 06c6820

File tree

6 files changed

+79
-195
lines changed

6 files changed

+79
-195
lines changed

base/Dockerfile

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,49 @@
1-
FROM centos:7
1+
FROM ubuntu:22.04
22

33
# utils
4-
RUN yum install -y epel-release ca-certificates && \
5-
yum install -y unzip \
6-
which \
7-
make \
8-
wget \
9-
zip \
10-
bzip2 \
11-
gcc \
12-
gcc-c++ \
13-
curl-devel \
14-
autoconf \
15-
expat-devel \
16-
gettext-devel \
17-
openssl-devel \
18-
perl-devel \
19-
zlib-devel \
20-
python-pip \
21-
java-1.8.0-openjdk && \
22-
yum -y clean all --enablerepo='*'
23-
24-
RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz && \
25-
tar zxvf git-2.9.5.tar.gz --no-same-owner && \
26-
cd git-2.9.5 && \
4+
RUN apt-get update && \
5+
apt-get install -y ca-certificates \
6+
gcc build-essential make autoconf cmake \
7+
zip bzip2 unzip \
8+
curl wget vim \
9+
libexpat1 libexpat1-dev gettext jq \
10+
libcurl4-openssl-dev openssl \
11+
perl \
12+
zlib1g-dev \
13+
openjdk-17-jdk && \
14+
apt-get clean autoclean
15+
16+
ENV GIT_VERSION 2.46.0
17+
RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz && \
18+
tar zxvf git-${GIT_VERSION}.tar.gz --no-same-owner && \
19+
cd git-${GIT_VERSION} && \
2720
make configure && \
2821
./configure prefix=/usr/local/git/ && \
2922
make && \
3023
make install && \
31-
mv /usr/local/git/bin/git /usr/bin/ && \
24+
ln -s /usr/local/git/bin/git /usr/bin/git && \
3225
cd ..&& \
33-
rm -rf git-2.9.5.tar.gz git-2.9.5 && \
26+
rm -rf git-${GIT_VERSION}.tar.gz git-${GIT_VERSION} && \
3427
git version
3528

36-
37-
3829
# Set the locale(en_US.UTF-8)
3930
ENV LANG en_US.UTF-8
4031
ENV LANGUAGE en_US:en
4132
ENV LC_ALL en_US.UTF-8
33+
ENV PATH $PATH:/usr/local/bin
4234

4335
# USER jenkins
4436
WORKDIR /home/jenkins
4537

46-
ENV SONAR_SCANNER_VERSION 3.3.0.1492
47-
38+
# install sonarqube
39+
ENV SONAR_SCANNER_VERSION 4.6.0.2311
4840
RUN curl -o sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip && \
49-
unzip sonar_scanner.zip && rm sonar_scanner.zip \
50-
&& rm -rf sonar-scanner-$SONAR_SCANNER_VERSION-linux/jre && \
41+
unzip sonar_scanner.zip && rm sonar_scanner.zip && \
42+
rm -rf sonar-scanner-$SONAR_SCANNER_VERSION-linux/jre && \
5143
sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner && \
52-
mv /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux /usr/bin
53-
54-
ENV PATH $PATH:/usr/bin/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin
44+
mv /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux /usr/local/lib && \
45+
ln -s /usr/local/lib/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner /usr/local/bin/sonar-scanner && \
46+
ln -s /usr/local/lib/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner-debug /usr/local/bin/sonar-scanner-debug
5547

5648
COPY ./ ./
5749
RUN ./hack/install_utils.sh && rm -rf ./*

base/podman/Dockerfile

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,57 @@
1-
FROM centos:7
1+
FROM ubuntu:22.04
22

33
# utils
4-
RUN yum install -y epel-release ca-certificates && \
5-
yum install -y unzip \
6-
which \
7-
make \
8-
wget \
9-
zip \
10-
bzip2 \
11-
gcc \
12-
gcc-c++ \
13-
curl-devel \
14-
autoconf \
15-
expat-devel \
16-
gettext-devel \
17-
openssl-devel \
18-
perl-devel \
19-
zlib-devel \
20-
python-pip \
21-
java-1.8.0-openjdk && \
22-
yum -y clean all --enablerepo='*'
23-
24-
RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz && \
25-
tar zxvf git-2.9.5.tar.gz --no-same-owner && \
26-
cd git-2.9.5 && \
4+
RUN apt-get update && \
5+
apt-get install -y ca-certificates \
6+
gcc build-essential make autoconf cmake \
7+
zip bzip2 unzip \
8+
curl wget vim \
9+
libexpat1 libexpat1-dev gettext jq \
10+
openssl \
11+
perl \
12+
zlib1g-dev \
13+
openjdk-17-jdk && \
14+
apt-get clean autoclean
15+
16+
ENV GIT_VERSION 2.46.0
17+
RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz && \
18+
tar zxvf git-${GIT_VERSION}.tar.gz --no-same-owner && \
19+
cd git-${GIT_VERSION} && \
2720
make configure && \
2821
./configure prefix=/usr/local/git/ && \
2922
make && \
3023
make install && \
3124
mv /usr/local/git/bin/git /usr/bin/ && \
32-
cd .. && \
33-
rm -rf git-2.9.5.tar.gz git-2.9.5 && \
25+
cd ..&& \
26+
rm -rf git-${GIT_VERSION}.tar.gz git-${GIT_VERSION} && \
3427
git version
3528

3629
# Set the locale(en_US.UTF-8)
3730
ENV LANG en_US.UTF-8
3831
ENV LANGUAGE en_US:en
3932
ENV LC_ALL en_US.UTF-8
33+
ENV PATH $PATH:/usr/local/bin
4034

4135
# USER jenkins
4236
WORKDIR /home/jenkins
4337

38+
# install sonarqube
4439
ENV SONAR_SCANNER_VERSION 3.3.0.1492
45-
4640
RUN curl -o sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip && \
47-
unzip sonar_scanner.zip && rm sonar_scanner.zip \
48-
&& rm -rf sonar-scanner-$SONAR_SCANNER_VERSION-linux/jre && \
41+
unzip sonar_scanner.zip && rm sonar_scanner.zip && \
42+
rm -rf sonar-scanner-$SONAR_SCANNER_VERSION-linux/jre && \
4943
sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner && \
50-
mv /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux /usr/bin
51-
52-
ENV PATH $PATH:/usr/bin/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin
53-
54-
COPY ./ ./
44+
mv /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux /usr/local/lib && \
45+
ln -s /usr/local/lib/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner /usr/local/bin/sonar-scanner && \
46+
ln -s /usr/local/lib/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner-debug /usr/local/bin/sonar-scanner-debug
5547

5648
ENV EXCLUDE_DOCKER 1
57-
RUN ./hack/install_utils.sh && rm -rf ./*
49+
COPY ./ ./
50+
RUN ./hack/install_utils.sh && mkdir -p /etc/containers && cp storage.conf containers.conf /etc/containers/ && rm -rf ./*
5851

5952
# Install podman
60-
RUN curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo && \
61-
yum -y install podman fuse-overlayfs && \
62-
ln -s /usr/bin/podman /usr/bin/docker && \
63-
yum -y clean all --enablerepo='*'
64-
65-
COPY storage.conf /etc/containers/storage.conf
66-
COPY containers.conf /etc/containers/containers.conf
53+
RUN apt-get install -y podman && apt-get clean autoclean
54+
RUN ln -s /usr/bin/podman /usr/bin/docker
6755

6856
VOLUME /var/lib/containers
6957

nodejs/Dockerfile

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,11 @@
1-
FROM kubespheredev/builder-base:v3.1.0
1+
FROM kubespheredev/builder-base:v4.1.0
22

3-
ENV NODE_VERSION 10.16.3
3+
ENV NODE_VERSION v16.20.2
44

5-
RUN ARCH= && uArch="$(uname -m)" \
6-
&& case "${uArch##*-}" in \
7-
x86_64) ARCH='x64';; \
8-
aarch64) ARCH='arm64';; \
9-
*) echo "unsupported architecture"; exit 1 ;; \
10-
esac \
11-
# gpg keys listed at https://github.com/nodejs/node#release-keys
12-
&& set -ex \
13-
&& for key in \
14-
4ED778F539E3634C779C87C6D7062848A1AB005C \
15-
141F07595B7B3FFE74309A937405533BE57C7D57 \
16-
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
17-
61FC681DFB92A079F1685E77973F295594EC4689 \
18-
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
19-
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
20-
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
21-
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
22-
108F52B48DB57BB0CC439B2997B01419BD92F80A \
23-
; do \
24-
gpg --batch --keyserver sks.srv.dumain.com --recv-keys "$key"; \
25-
done \
26-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
27-
&& curl -fsSLO https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt \
28-
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
29-
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
30-
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt \
31-
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
32-
&& yum install -y nodejs gcc-c++ make bzip2 GConf2 gtk2 chromedriver chromium xorg-x11-server-Xvfb
5+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh && \
6+
bash nodesource_setup.sh && \
7+
apt-get install nodejs -y && \
8+
node -v && npm -v
339

34-
RUN npm -g config set user root
35-
RUN npm i -g watch-cli vsce typescript
36-
37-
# Yarn
38-
ENV YARN_VERSION 1.16.0
39-
RUN curl -f -L -o /tmp/yarn.tgz https://github.com/yarnpkg/yarn/releases/download/v${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz && \
40-
tar xf /tmp/yarn.tgz && \
41-
mv yarn-v${YARN_VERSION} /opt/yarn && \
42-
ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn && \
43-
yarn config set cache-folder /root/.yarn
10+
RUN npm install -g yarn && \
11+
yarn config set cache-folder /root/.yarn

nodejs/podman/Dockerfile

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,11 @@
1-
FROM kubespheredev/builder-base:v3.1.0-podman
1+
FROM kubespheredev/builder-base:v4.1.0-podman
22

3-
ENV NODE_VERSION 10.16.3
3+
ENV NODE_VERSION v16.20.2
44

5-
RUN ARCH= && uArch="$(uname -m)" \
6-
&& case "${uArch##*-}" in \
7-
x86_64) ARCH='x64';; \
8-
aarch64) ARCH='arm64';; \
9-
*) echo "unsupported architecture"; exit 1 ;; \
10-
esac \
11-
# gpg keys listed at https://github.com/nodejs/node#release-keys
12-
&& set -ex \
13-
&& for key in \
14-
4ED778F539E3634C779C87C6D7062848A1AB005C \
15-
141F07595B7B3FFE74309A937405533BE57C7D57 \
16-
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
17-
61FC681DFB92A079F1685E77973F295594EC4689 \
18-
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
19-
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
20-
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
21-
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
22-
108F52B48DB57BB0CC439B2997B01419BD92F80A \
23-
; do \
24-
gpg --batch --keyserver sks.srv.dumain.com --recv-keys "$key"; \
25-
done \
26-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
27-
&& curl -fsSLO https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt \
28-
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
29-
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
30-
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt \
31-
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
32-
&& yum install -y nodejs gcc-c++ make bzip2 GConf2 gtk2 chromedriver chromium xorg-x11-server-Xvfb
5+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh && \
6+
bash nodesource_setup.sh && \
7+
apt-get install nodejs -y && \
8+
node -v && npm -v
339

34-
RUN npm -g config set user root
35-
RUN npm i -g watch-cli vsce typescript
36-
37-
# Yarn
38-
ENV YARN_VERSION 1.16.0
39-
RUN curl -f -L -o /tmp/yarn.tgz https://github.com/yarnpkg/yarn/releases/download/v${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz && \
40-
tar xf /tmp/yarn.tgz && \
41-
mv yarn-v${YARN_VERSION} /opt/yarn && \
42-
ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn && \
43-
yarn config set cache-folder /root/.yarn
10+
RUN npm install -g yarn && \
11+
yarn config set cache-folder /root/.yarn

python/Dockerfile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
FROM kubespheredev/builder-base:v3.1.0
1+
FROM kubespheredev/builder-base:v4.1.0
22

3-
# python3
4-
ENV PYTHON_VERSION=3.7.11
5-
RUN yum -y install bzip2-devel libffi-devel libsqlite3x-devel && \
6-
curl -fSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /usr/src/Python-${PYTHON_VERSION}.tgz && \
7-
tar xzf /usr/src/Python-${PYTHON_VERSION}.tgz -C /usr/src/ --no-same-owner && \
8-
cd /usr/src/Python-${PYTHON_VERSION} && \
9-
./configure --enable-optimizations --with-ensurepip=install --enable-loadable-sqlite-extensions && \
10-
make altinstall -j 2 && \
11-
cd ../ && \
12-
rm -rf /usr/src/Python-${PYTHON_VERSION}.tgz /usr/src/Python-${PYTHON_VERSION} && \
13-
ln -fs /usr/local/bin/python3.7 /usr/bin/python && \
14-
ln -fs /usr/local/bin/python3.7 /usr/bin/python3 && \
15-
ln -fs /usr/local/bin/pip3.7 /usr/bin/pip && \
16-
python3 -m pip install --upgrade pip && \
17-
sed -e 's|^#!/usr/bin/python|#!/usr/bin/python2.7|g' -i.bak /usr/bin/yum && \
18-
sed -e 's|^#! /usr/bin/python|#! /usr/bin/python2.7|g' -i.bak /usr/libexec/urlgrabber-ext-down && \
19-
yum -y remove bzip2-devel libffi-devel libsqlite3x-devel && \
20-
yum -y clean all
3+
# python:3.10.12 pip:22.0.2
4+
RUN apt-get install -y python3 pip && apt-get clean autoclean && ln -s /usr/bin/python3 /usr/bin/python
215

226
CMD ["python","--version"]

python/podman/Dockerfile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
FROM kubespheredev/builder-base:v3.1.0-podman
1+
FROM kubespheredev/builder-base:v4.1.0-podman
22

3-
# python3
4-
ENV PYTHON_VERSION=3.7.11
5-
RUN yum -y install bzip2-devel libffi-devel libsqlite3x-devel && \
6-
curl -fSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /usr/src/Python-${PYTHON_VERSION}.tgz && \
7-
tar xzf /usr/src/Python-${PYTHON_VERSION}.tgz -C /usr/src/ --no-same-owner && \
8-
cd /usr/src/Python-${PYTHON_VERSION} && \
9-
./configure --enable-optimizations --with-ensurepip=install --enable-loadable-sqlite-extensions && \
10-
make altinstall -j 2 && \
11-
cd ../ && \
12-
rm -rf /usr/src/Python-${PYTHON_VERSION}.tgz /usr/src/Python-${PYTHON_VERSION} && \
13-
ln -fs /usr/local/bin/python3.7 /usr/bin/python && \
14-
ln -fs /usr/local/bin/python3.7 /usr/bin/python3 && \
15-
ln -fs /usr/local/bin/pip3.7 /usr/bin/pip && \
16-
python3 -m pip install --upgrade pip && \
17-
sed -e 's|^#!/usr/bin/python|#!/usr/bin/python2.7|g' -i.bak /usr/bin/yum && \
18-
sed -e 's|^#! /usr/bin/python|#! /usr/bin/python2.7|g' -i.bak /usr/libexec/urlgrabber-ext-down && \
19-
yum -y remove bzip2-devel libffi-devel libsqlite3x-devel && \
20-
yum -y clean all
3+
# python:3.10.12 pip:22.0.2
4+
RUN apt-get install -y python3 pip && apt-get clean autoclean && ln -s /usr/bin/python3 /usr/bin/python
215

226
CMD ["python","--version"]

0 commit comments

Comments
 (0)