From a847ef1ea8062c09b42b1ea1b048a388c9e593fc Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Thu, 20 Jul 2023 21:54:43 +0900 Subject: drop centos8, add almalinux 8.8, update rocky to 8.8 And cleanup Docker files --- docker/README.md | 19 ++++++------------- docker/almalinux-8.8.Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ docker/alpine-3.17.Dockerfile | 23 ++++++++++++----------- docker/centos-8.Dockerfile | 39 --------------------------------------- docker/rocky-8.6.Dockerfile | 35 ----------------------------------- docker/rocky-8.8.Dockerfile | 35 +++++++++++++++++++++++++++++++++++ docker/ubuntu-20.04.Dockerfile | 8 ++++---- docker/ubuntu-22.04.Dockerfile | 7 +++---- 8 files changed, 96 insertions(+), 106 deletions(-) create mode 100644 docker/almalinux-8.8.Dockerfile delete mode 100644 docker/centos-8.Dockerfile delete mode 100644 docker/rocky-8.6.Dockerfile create mode 100644 docker/rocky-8.8.Dockerfile (limited to 'docker') diff --git a/docker/README.md b/docker/README.md index 8c58949..8e3dbe9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -8,9 +8,7 @@ docker build -t mscp-ubuntu:20.04 -f docker/ubuntu-20.04.Dockerfile . docker build -t mscp-ubuntu:22.04 -f docker/ubuntu-22.04.Dockerfile . -docker build -t mscp-centos:8 -f docker/centos-8.Dockerfile . - -docker build -t mscp-rocky:8.6 -f docker/rocky-8.6.Dockerfile . +docker build -t mscp-rocky:8.8 -f docker/rocky-8.Dockerfile . ``` Test `mscp` in the containers. @@ -20,25 +18,20 @@ docker run --init --rm mscp-ubuntu:20.04 /mscp/scripts/test-in-container.sh docker run --init --rm mscp-ubuntu:22.04 /mscp/scripts/test-in-container.sh -docker run --init --rm mscp-centos:8 /mscp/scripts/test-in-container.sh - -docker run --init --rm mscp-rocky:8.6 /mscp/scripts/test-in-container.sh +docker run --init --rm mscp-rocky:8.9 /mscp/scripts/test-in-container.sh ``` Retrieve deb/rpm packages. ```console docker run --rm -v (pwd):/out mscp-ubuntu:20.04 \ - cp /mscp/build/mscp_0.0.0-ubuntu-20.04-x86_64.deb /out/ + cp /mscp/build/mscp_ubuntu-20.04-x86_64.deb /out/ docker run --rm -v (pwd):/out mscp-ubuntu:22.04 \ - cp /mscp/build/mscp_0.0.0-ubuntu-22.04-x86_64.deb /out/ - -docker run --rm -v (pwd):/out mscp-centos:8 \ - cp /mscp/build/mscp_0.0.0-centos-8-x86_64.rpm /out/ + cp /mscp/build/mscp_ubuntu-22.04-x86_64.deb /out/ -docker run --rm -v (pwd):/out mscp-rocky:8.6 \ - cp /mscp/build/mscp_0.0.0-rocky-8.6-x86_64.rpm /out/ +docker run --rm -v (pwd):/out mscp-rocky:8.8 \ + cp /mscp/build/mscp_rocky-8.8-x86_64.rpm /out/ ``` I don't know whether these are good way. \ No newline at end of file diff --git a/docker/almalinux-8.8.Dockerfile b/docker/almalinux-8.8.Dockerfile new file mode 100644 index 0000000..f7a9ace --- /dev/null +++ b/docker/almalinux-8.8.Dockerfile @@ -0,0 +1,36 @@ +FROM almalinux:8.8 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install \ + python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build + +RUN python3 -m pip install pytest + + +# preparation for sshd +RUN mkdir /var/run/sshd \ + && ssh-keygen -A \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make \ + && cpack -G RPM CPackConfig.cmake \ + && rpm -iv *.rpm + +# install mscp python module +RUN cd ${mscpdir} \ + && python3 setup.py install --user + diff --git a/docker/alpine-3.17.Dockerfile b/docker/alpine-3.17.Dockerfile index a49d0ee..4a76c01 100644 --- a/docker/alpine-3.17.Dockerfile +++ b/docker/alpine-3.17.Dockerfile @@ -2,18 +2,26 @@ FROM alpine:3.17 # Build mscp with conan to create single binary mscp -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - RUN apk add --no-cache \ gcc make cmake python3 py3-pip perl linux-headers libc-dev \ openssh bash python3-dev g++ RUN pip3 install conan pytest +# preparation for sshd +RUN ssh-keygen -A +RUN mkdir /var/run/sshd \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + + # Build mscp as a single binary RUN conan profile detect --force + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + RUN cd ${mscpdir} \ && rm -rf build \ && conan install . --output-folder=build --build=missing \ @@ -25,15 +33,8 @@ RUN cd ${mscpdir} \ && make \ && cp mscp /usr/bin/ \ && cp mscp /mscp/build/mscp_alpine-3.17-x86_64.static - # copy mscp to PKG FILE NAME because this build doesn't use CPACK -# preparation for sshd -RUN ssh-keygen -A -RUN mkdir /var/run/sshd \ - && ssh-keygen -f /root/.ssh/id_rsa -N "" \ - && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys - # install mscp python module RUN cd ${mscpdir} \ && python3 setup.py install --user diff --git a/docker/centos-8.Dockerfile b/docker/centos-8.Dockerfile deleted file mode 100644 index 3059715..0000000 --- a/docker/centos-8.Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM centos:8 - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -# from https://stackoverflow.com/questions/70963985/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal -RUN cd /etc/yum.repos.d/ -RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* -RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* - -# install pytest, sshd for test, and rpm-build -RUN set -ex && yum -y update && yum -y install \ - python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build - -RUN python3 -m pip install pytest - - -# preparation for sshd -RUN mkdir /var/run/sshd \ - && ssh-keygen -A \ - && ssh-keygen -f /root/.ssh/id_rsa -N "" \ - && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# build -RUN cd ${mscpdir} \ - && rm -rf build \ - && cmake -B build \ - && cd ${mscpdir}/build \ - && make \ - && cpack -G RPM CPackConfig.cmake \ - && rpm -iv *.rpm - -# install mscp python module -RUN cd ${mscpdir} \ - && python3 setup.py install --user diff --git a/docker/rocky-8.6.Dockerfile b/docker/rocky-8.6.Dockerfile deleted file mode 100644 index 35d18a8..0000000 --- a/docker/rocky-8.6.Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM rockylinux:8.6 - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -# install pytest, sshd for test, and rpm-build -RUN set -ex && yum -y install \ - python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build - -RUN python3 -m pip install pytest - - -# preparation for sshd -RUN mkdir /var/run/sshd \ - && ssh-keygen -A \ - && ssh-keygen -f /root/.ssh/id_rsa -N "" \ - && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# build -RUN cd ${mscpdir} \ - && rm -rf build \ - && cmake -B build \ - && cd ${mscpdir}/build \ - && make \ - && cpack -G RPM CPackConfig.cmake \ - && rpm -iv *.rpm - -# install mscp python module -RUN cd ${mscpdir} \ - && python3 setup.py install --user - diff --git a/docker/rocky-8.8.Dockerfile b/docker/rocky-8.8.Dockerfile new file mode 100644 index 0000000..b09c626 --- /dev/null +++ b/docker/rocky-8.8.Dockerfile @@ -0,0 +1,35 @@ +FROM rockylinux:8.8 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install \ + python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build + +RUN python3 -m pip install pytest + + +# preparation for sshd +RUN mkdir /var/run/sshd \ + && ssh-keygen -A \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make \ + && cpack -G RPM CPackConfig.cmake \ + && rpm -iv *.rpm + +# install mscp python module +RUN cd ${mscpdir} \ + && python3 setup.py install --user + diff --git a/docker/ubuntu-20.04.Dockerfile b/docker/ubuntu-20.04.Dockerfile index d00f7c8..707a79d 100644 --- a/docker/ubuntu-20.04.Dockerfile +++ b/docker/ubuntu-20.04.Dockerfile @@ -1,10 +1,6 @@ FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ ca-certificates @@ -21,6 +17,10 @@ RUN mkdir /var/run/sshd \ && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + # install build dependency RUN ${mscpdir}/scripts/install-build-deps.sh diff --git a/docker/ubuntu-22.04.Dockerfile b/docker/ubuntu-22.04.Dockerfile index e2c6f47..673d880 100644 --- a/docker/ubuntu-22.04.Dockerfile +++ b/docker/ubuntu-22.04.Dockerfile @@ -1,10 +1,6 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ ca-certificates @@ -20,6 +16,9 @@ RUN mkdir /var/run/sshd \ && ssh-keygen -f /root/.ssh/id_rsa -N "" \ && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys +ARG mscpdir="/mscp" + +COPY . ${mscpdir} # install build dependency RUN ${mscpdir}/scripts/install-build-deps.sh -- cgit v1.2.3