remove yum install yum-utils and add generating repository iso dockerfile

Signed-off-by: 24sama <leo@kubesphere.io>
This commit is contained in:
24sama 2022-01-17 14:40:52 +08:00
parent 90626d1a59
commit af2472d7cc
6 changed files with 80 additions and 1 deletions

View File

@ -0,0 +1,15 @@
FROM centos:centos7
WORKDIR package
ENV DIR=centos-7-amd64-rpms
ENV DOCKERVERSION=20.10.8
RUN mkdir ${DIR} && cd ${DIR} && \
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
yumdownloader --resolve --destdir ./ docker-ce-${DOCKERVERSION} docker-ce-cli-${DOCKERVERSION} containerd.io \
nss nss-sysinit nss-tools lz4 chrony bind-utils nfs-utils net-tools ipvsadm ceph-common glusterfs-fuse yum-utils \
curl openssl socat conntrack ebtables ipset telnet lvm2 keepalived haproxy psmisc tcpdump && \
yum install createrepo mkisofs -y && createrepo ./
RUN mkisofs -r -o ${DIR}.iso ${DIR}

View File

@ -0,0 +1,19 @@
FROM ubuntu:16.04
WORKDIR package
ENV DIR=ubuntu-16.04-amd64-debs
ENV DOCKERVERSION=5:20.10.7~3-0~ubuntu-xenial
ENV PACKAGES="apt-transport-https ca-certificates curl git gnupg-agent software-properties-common sudo openssl openssh-server socat conntrack ebtables ipset docker-ce=${DOCKERVERSION} docker-ce-cli=${DOCKERVERSION} containerd.io chrony ipvsadm nfs-common ceph-common glusterfs-client dnsutils telnet lvm2 keepalived haproxy psmisc tcpdump"
RUN mkdir ${DIR} && apt update && apt install curl sudo software-properties-common apt-transport-https -y && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" && \
add-apt-repository ppa:gluster/glusterfs-7 -y && apt update
ADD download-pkgs.sh ./${DIR}/
RUN cd ${DIR} && sh download-pkgs.sh && rm -rf download-pkgs.sh && rm -rf
RUN apt install apt-utils dpkg-dev -y && cd ${DIR} && dpkg-scanpackages ./ /dev/null |gzip > ./Packages.gz
RUN apt-get install genisoimage -y && mkisofs -r -o ${DIR}.iso ${DIR}

View File

@ -0,0 +1,19 @@
FROM ubuntu:18.04
WORKDIR package
ENV DIR=ubuntu-18.04-amd64-debs
ENV DOCKERVERSION=5:20.10.8~3-0~ubuntu-bionic
ENV PACKAGES="apt-transport-https ca-certificates curl git gnupg-agent software-properties-common sudo openssl openssh-server socat conntrack ebtables ipset docker-ce=${DOCKERVERSION} docker-ce-cli=${DOCKERVERSION} containerd.io chrony ipvsadm nfs-common ceph-common glusterfs-client dnsutils telnet lvm2 keepalived haproxy psmisc tcpdump"
RUN mkdir ${DIR} && apt update && apt install curl sudo software-properties-common apt-transport-https -y && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \
add-apt-repository ppa:gluster/glusterfs-7 -y && apt update
ADD download-pkgs.sh ./${DIR}/
RUN cd ${DIR} && sh download-pkgs.sh && rm -rf download-pkgs.sh && rm -rf errors.txt
RUN apt install apt-utils dpkg-dev -y && cd ${DIR} && dpkg-scanpackages ./ /dev/null |gzip > ./Packages.gz
RUN apt-get install genisoimage -y && mkisofs -r -o ${DIR}.iso ${DIR}

View File

@ -0,0 +1,19 @@
FROM ubuntu:20.04
WORKDIR package
ENV DIR=ubuntu-20.04-amd64-debs
ENV DOCKERVERSION=5:20.10.8~3-0~ubuntu-focal
ENV PACKAGES="apt-transport-https ca-certificates curl git gnupg-agent software-properties-common sudo openssl openssh-server socat conntrack ebtables ipset docker-ce=${DOCKERVERSION} docker-ce-cli=${DOCKERVERSION} containerd.io chrony ipvsadm nfs-common ceph-common glusterfs-client dnsutils telnet lvm2 keepalived haproxy psmisc tcpdump"
RUN mkdir ${DIR} && apt update && apt install curl sudo software-properties-common apt-transport-https -y && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" && \
add-apt-repository ppa:gluster/glusterfs-7 -y && apt update
ADD download-pkgs.sh ./${DIR}/
RUN cd ${DIR} && sh download-pkgs.sh && rm -rf download-pkgs.sh && rm -rf errors.txt
RUN apt install apt-utils dpkg-dev -y && cd ${DIR} && dpkg-scanpackages ./ /dev/null |gzip > ./Packages.gz
RUN apt-get install genisoimage -y && mkisofs -r -o ${DIR}.iso ${DIR}

View File

@ -0,0 +1,7 @@
#! /bin/sh
for p in ${PACKAGES} ; do
echo "\n Download $p ... \n"
sudo apt-get download $p 2>>errors.txt
for i in $(apt-cache depends $p | grep -E 'Depends|Recommends|Suggests' | cut -d ':' -f 2,3 | sed -e s/' '/''/); do sudo apt-get download $i 2>>errors.txt; done
done

View File

@ -82,7 +82,7 @@ func (r *RedhatPackageManager) Update() error {
func (r *RedhatPackageManager) Install(pkg ...string) error {
if len(pkg) == 0 {
pkg = []string{"yum-utils", "openssl", "socat", "conntrack", "ipset", "ebtables", "chrony"}
pkg = []string{"openssl", "socat", "conntrack", "ipset", "ebtables", "chrony"}
}
str := strings.Join(pkg, " ")