diff options
| author | Ryo Nakamura <upa@haeena.net> | 2023-07-20 21:54:43 +0900 |
|---|---|---|
| committer | Ryo Nakamura <upa@haeena.net> | 2023-07-20 21:54:43 +0900 |
| commit | a847ef1ea8062c09b42b1ea1b048a388c9e593fc (patch) | |
| tree | c53ae68be8be157be0f0f17957d53dd8617a7177 /docker | |
| parent | 24e86f58d87d48864e6ae33f1953124e467753ea (diff) | |
drop centos8, add almalinux 8.8, update rocky to 8.8
And cleanup Docker files
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/README.md | 19 | ||||
| -rw-r--r-- | docker/almalinux-8.8.Dockerfile (renamed from docker/rocky-8.6.Dockerfile) | 11 | ||||
| -rw-r--r-- | docker/alpine-3.17.Dockerfile | 23 | ||||
| -rw-r--r-- | docker/rocky-8.8.Dockerfile (renamed from docker/centos-8.Dockerfile) | 20 | ||||
| -rw-r--r-- | docker/ubuntu-20.04.Dockerfile | 8 | ||||
| -rw-r--r-- | docker/ubuntu-22.04.Dockerfile | 7 |
6 files changed, 39 insertions, 49 deletions
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/rocky-8.6.Dockerfile b/docker/almalinux-8.8.Dockerfile index 35d18a8..f7a9ace 100644 --- a/docker/rocky-8.6.Dockerfile +++ b/docker/almalinux-8.8.Dockerfile @@ -1,8 +1,4 @@ -FROM rockylinux:8.6 - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} +FROM almalinux:8.8 # install pytest, sshd for test, and rpm-build RUN set -ex && yum -y install \ @@ -17,6 +13,11 @@ 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 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/rocky-8.8.Dockerfile index 3059715..b09c626 100644 --- a/docker/centos-8.Dockerfile +++ b/docker/rocky-8.8.Dockerfile @@ -1,16 +1,7 @@ -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-* +FROM rockylinux:8.8 # install pytest, sshd for test, and rpm-build -RUN set -ex && yum -y update && yum -y install \ +RUN set -ex && yum -y install \ python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build RUN python3 -m pip install pytest @@ -22,13 +13,17 @@ 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 # build RUN cd ${mscpdir} \ && rm -rf build \ - && cmake -B build \ + && cmake -B build \ && cd ${mscpdir}/build \ && make \ && cpack -G RPM CPackConfig.cmake \ @@ -37,3 +32,4 @@ RUN cd ${mscpdir} \ # 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 |
