-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): add build strategy in workflow (#6)
* feat(build): add centos8 and ubuntu18 os * chore(build): add build strategy in workflow * chore(build): add fedora33 fedora34 build dockerfile * chore(build): fix centos8 yum repo metadata error
- Loading branch information
Showing
12 changed files
with
271 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
FROM centos:7.9.2009 as os-centos7 | ||
ARG OS_VERSION=7 | ||
ARG DOCKER_MIRROR_URL="https://download.docker.com" | ||
ARG BUILD_TOOLS="yum-utils createrepo epel-release wget" | ||
|
||
RUN yum install -q -y ${BUILD_TOOLS} \ | ||
&& yum-config-manager --add-repo ${DOCKER_MIRROR_URL}/linux/centos/docker-ce.repo \ | ||
&& yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \ | ||
&& yum makecache | ||
|
||
WORKDIR /centos/$OS_VERSION/os | ||
COPY packages.yaml . | ||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
RUN yq eval '.common[],.yum[],.centos7[],.kubespray.common[],.kubespray.yum[]' packages.yaml > packages.list \ | ||
&& sort -u packages.list | xargs repotrack --urls | sort -u > packages.urls | ||
RUN yq eval '.common[],.yum[],.centos7[],.kubespray.common[],.kubespray.yum[]' packages.yaml > packages.list | ||
|
||
RUN ARCH=$(uname -m) \ | ||
&& wget -q -x -P ${ARCH} -i packages.urls \ | ||
&& sort -u packages.list | xargs repotrack -p ${ARCH} \ | ||
&& createrepo -d ${ARCH} | ||
|
||
FROM scratch | ||
COPY --from=os-centos7 /centos /centos | ||
COPY --from=os-centos7 /centos /resources/nginx/centos | ||
COPY repos/CentOS-All-in-One.repo /resources/nginx/repos/CentOS-7-All-in-One.repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM centos:8 as os-centos8 | ||
ARG OS_VERSION=8 | ||
ARG BUILD_TOOLS="yum-utils createrepo epel-release wget" | ||
|
||
RUN ARCH=$(uname -m) \ | ||
&& dnf install -q -y ${BUILD_TOOLS} \ | ||
&& dnf install -q -y http://mirror.centos.org/centos/8-stream/AppStream/${ARCH}/os/Packages/modulemd-tools-0.7-4.el8.noarch.rpm \ | ||
&& yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \ | ||
&& dnf makecache | ||
|
||
WORKDIR /centos/$OS_VERSION/os | ||
COPY packages.yaml . | ||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
RUN yq eval '.common[],.yum[],.centos8[],.kubespray.common[],.kubespray.yum[]' packages.yaml > packages.list | ||
|
||
RUN ARCH=$(uname -m) \ | ||
&& sort -u packages.list | xargs repotrack --destdir ${ARCH} \ | ||
&& createrepo_c ${ARCH} \ | ||
&& repo2module -s stable ${ARCH} ${ARCH}/modules.yaml \ | ||
&& modifyrepo_c --mdtype=modules ${ARCH}/modules.yaml ${ARCH}/repodata | ||
|
||
FROM scratch | ||
COPY --from=os-centos8 /centos /resources/nginx/centos | ||
COPY repos/CentOS-All-in-One.repo /resources/nginx/repos/CentOS-8-All-in-One.repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM debian:stretch-slim as os-stretch | ||
ARG TARGETARCH | ||
ARG OS_VERSION=stretch | ||
ARG DEP_PACKAGES="apt-transport-https ca-certificates curl wget gnupg dpkg-dev" | ||
|
||
RUN ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') \ | ||
&& apt update -qq \ | ||
&& apt install -y -qq --no-install-recommends $DEP_PACKAGES \ | ||
&& curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - \ | ||
&& echo "deb [arch=${ARCH}] https://download.docker.com/linux/debian ${OS_VERSION} stable" > /etc/apt/sources.list.d/docker.list \ | ||
&& apt update -qq | ||
|
||
WORKDIR /debian/${TARGETARCH} | ||
COPY packages.yaml . | ||
|
||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
RUN yq eval '.common[],.apt[],.kubespray.common[],.kubespray.apt[],.debian9[]' packages.yaml > packages.list \ | ||
&& dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 >> packages.list \ | ||
&& sort -u packages.list | xargs apt-get install --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls | ||
|
||
RUN wget -q -x -P ${OS_VERSION} -i packages.urls \ | ||
&& dpkg-scanpackages ${OS_VERSION} | gzip -9c > ${OS_VERSION}/Packages.gz | ||
|
||
FROM scratch | ||
COPY --from=os-stretch /debian /resources/nginx/debian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM fedora:33 as os-fedora33 | ||
ARG OS_VERSION=33 | ||
ARG BUILD_TOOLS="yum-utils createrepo findutils" | ||
|
||
RUN dnf install -q -y ${BUILD_TOOLS} | ||
RUN yum-config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | ||
RUN dnf makecache -q | ||
|
||
WORKDIR /fedora/$OS_VERSION/os | ||
COPY packages.yaml . | ||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
RUN yq eval '.common[],.yum[],.fedora[],.fedora33[],.kubespray.common[],.kubespray.yum[]' packages.yaml > packages.list | ||
|
||
RUN ARCH=$(uname -m) \ | ||
&& sort -u packages.list | xargs repotrack --destdir ${ARCH} \ | ||
&& createrepo -d ${ARCH} | ||
|
||
FROM scratch | ||
COPY --from=os-fedora33 /fedora /resources/nginx/fedora | ||
COPY repos/Fedora-All-in-One.repo /resources/nginx/repos/Fedora-33-All-in-One.repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM fedora:34 as os-fedora34 | ||
ARG OS_VERSION=34 | ||
ARG BUILD_TOOLS="yum-utils createrepo findutils" | ||
|
||
RUN dnf install -q -y ${BUILD_TOOLS} \ | ||
&& yum-config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo \ | ||
&& dnf makecache -q | ||
|
||
WORKDIR /fedora/$OS_VERSION/os | ||
COPY packages.yaml . | ||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
RUN yq eval '.common[],.yum[],.fedora[],.fedora34[],.kubespray.common[],.kubespray.yum[]' packages.yaml > packages.list | ||
|
||
RUN ARCH=$(uname -m) \ | ||
&& sort -u packages.list | xargs repotrack --destdir ${ARCH} \ | ||
&& createrepo -d ${ARCH} | ||
|
||
FROM scratch | ||
COPY --from=os-fedora34 /fedora /resources/nginx/fedora | ||
COPY repos/Fedora-All-in-One.repo /resources/nginx/repos/Fedora-34-All-in-One.repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ubuntu:bionic as os-bionic | ||
ARG TARGETARCH | ||
ARG OS_VERSION=bionic | ||
ARG DEP_PACKAGES="apt-transport-https ca-certificates curl wget gnupg dpkg-dev" | ||
|
||
RUN ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') \ | ||
&& apt update -qq \ | ||
&& apt install -y --no-install-recommends $DEP_PACKAGES \ | ||
&& curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - \ | ||
&& echo "deb [arch=$ARCH] https://download.docker.com/linux/ubuntu ${OS_VERSION} stable" > /etc/apt/sources.list.d/docker.list\ | ||
&& apt update -qq | ||
|
||
WORKDIR /ubuntu/${TARGETARCH} | ||
COPY packages.yaml . | ||
|
||
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq | ||
RUN yq eval '.common[],.apt[],.kubespray.common[],.kubespray.apt[],.ubuntu[]' packages.yaml > packages.list \ | ||
&& dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 >> packages.list \ | ||
&& sort -u packages.list | xargs apt-get install --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls | ||
|
||
RUN wget -q -x -P ${OS_VERSION} -i packages.urls \ | ||
&& dpkg-scanpackages ${OS_VERSION} | gzip -9c > ${OS_VERSION}/Packages.gz | ||
|
||
FROM scratch | ||
COPY --from=os-bionic /ubuntu /resources/nginx/ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.