|
1 | | -FROM centos:7 |
| 1 | +FROM ubuntu:22.04 |
2 | 2 |
|
3 | 3 | # 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} && \ |
27 | 20 | make configure && \ |
28 | 21 | ./configure prefix=/usr/local/git/ && \ |
29 | 22 | make && \ |
30 | 23 | make install && \ |
31 | 24 | 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} && \ |
34 | 27 | git version |
35 | 28 |
|
36 | 29 | # Set the locale(en_US.UTF-8) |
37 | 30 | ENV LANG en_US.UTF-8 |
38 | 31 | ENV LANGUAGE en_US:en |
39 | 32 | ENV LC_ALL en_US.UTF-8 |
| 33 | +ENV PATH $PATH:/usr/local/bin |
40 | 34 |
|
41 | 35 | # USER jenkins |
42 | 36 | WORKDIR /home/jenkins |
43 | 37 |
|
| 38 | +# install sonarqube |
44 | 39 | ENV SONAR_SCANNER_VERSION 3.3.0.1492 |
45 | | - |
46 | 40 | 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 && \ |
49 | 43 | 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 |
55 | 47 |
|
56 | 48 | 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 ./* |
58 | 51 |
|
59 | 52 | # 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 |
67 | 55 |
|
68 | 56 | VOLUME /var/lib/containers |
69 | 57 |
|
|
0 commit comments