summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-02-11 14:04:43 +0900
committerRyo Nakamura <upa@haeena.net>2024-02-11 14:04:43 +0900
commit45ba6b077ede13170855a9a985d06c067fd52a24 (patch)
tree9e43010eb8be502c7af6eb8055c3e704f36ece12 /Dockerfile
parentd819f715c8ab5abd3c02459eb9967cfc00136e34 (diff)
install-build-deps.sh has --dont-install and --platform options.
All docker files do not call isntall-build-deps.sh. Instead, cmake passes REQUIREDPKGS to Dockerfiles, which is derived from the output of ./scripts/install-build-deps.sh --dont-install --platform PLATFORM. This change enables caching package installaion during docker build.
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile/.gitignore3
-rw-r--r--Dockerfile/README.md20
-rw-r--r--Dockerfile/almalinux-9.3.Dockerfile8
-rw-r--r--Dockerfile/alpine-3.19.Dockerfile9
-rw-r--r--Dockerfile/build-deb.Dockerfile8
-rw-r--r--Dockerfile/build-srpm.Dockerfile (renamed from Dockerfile/build-srpm.Dockerfile.in)12
-rw-r--r--Dockerfile/rocky-8.9.Dockerfile9
-rw-r--r--Dockerfile/rocky-9.3.Dockerfile9
-rw-r--r--Dockerfile/ubuntu-20.04.Dockerfile13
-rw-r--r--Dockerfile/ubuntu-22.04.Dockerfile13
10 files changed, 41 insertions, 63 deletions
diff --git a/Dockerfile/.gitignore b/Dockerfile/.gitignore
deleted file mode 100644
index adab824..0000000
--- a/Dockerfile/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-
-# generated by cmake
-build-srpm.Dockerfile
diff --git a/Dockerfile/README.md b/Dockerfile/README.md
index ff6d45b..6d2245c 100644
--- a/Dockerfile/README.md
+++ b/Dockerfile/README.md
@@ -1,19 +1,7 @@
Dockerfiles for building and testing mscp.
-Build container:
-
-```
-docker build -t mscp-DIST:VER -f docker/DIST-VER.Dockerfile .
-```
-
-Run test:
-
-```
-docker run --init --rm mscp-DST:VER /mscp/scripts/test-in-container.sh
-```
-
-Custom targets to build and test mscp in the containers are provided
-via `cmake`. See `make docker-*` targets. `make docker-build-all`
-builds all container images, and `make docker-test-all` runs the test
-in all container images. \ No newline at end of file
+cmake provides custom targets to build and test mscp in the containers
+See `make docker-*` targets. `make docker-build-all` builds all
+container images, and `make docker-test-all` runs the test in all
+container images. \ No newline at end of file
diff --git a/Dockerfile/almalinux-9.3.Dockerfile b/Dockerfile/almalinux-9.3.Dockerfile
index 3286f72..640cb6b 100644
--- a/Dockerfile/almalinux-9.3.Dockerfile
+++ b/Dockerfile/almalinux-9.3.Dockerfile
@@ -1,8 +1,11 @@
FROM almalinux:9.3
+ARG REQUIREDPKGS
+
# 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
+ ${REQUIREDPKGS} python3 python3-pip python3-devel \
+ openssh openssh-server openssh-clients rpm-build
RUN python3 -m pip install pytest
@@ -28,9 +31,6 @@ ARG mscpdir="/mscp"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
# build
RUN cd ${mscpdir} \
&& rm -rf build \
diff --git a/Dockerfile/alpine-3.19.Dockerfile b/Dockerfile/alpine-3.19.Dockerfile
index a338161..054d93f 100644
--- a/Dockerfile/alpine-3.19.Dockerfile
+++ b/Dockerfile/alpine-3.19.Dockerfile
@@ -1,10 +1,15 @@
FROM alpine:3.19
+# do not use REQUIREDPKGS build argument because
+# this Dockerfile compiles mscp with conan,so we do not need
+# libssl-dev and zlib-dev
+
# Build mscp with conan to create single binary mscp
RUN apk add --no-cache \
- gcc make cmake python3 py3-pip perl linux-headers libc-dev \
- openssh bash python3-dev py3-pytest g++
+ gcc make cmake libc-dev \
+ linux-headers openssh bash perl \
+ python3 py3-pip python3-dev py3-pytest g++
RUN pip3 install --break-system-packages conan
diff --git a/Dockerfile/build-deb.Dockerfile b/Dockerfile/build-deb.Dockerfile
index 7d489d9..2b8d71e 100644
--- a/Dockerfile/build-deb.Dockerfile
+++ b/Dockerfile/build-deb.Dockerfile
@@ -1,16 +1,16 @@
FROM ubuntu:22.04
+ARG REQUIREDPKGS
+
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
- ca-certificates build-essential devscripts debhelper gcc make cmake
+ ${REQUIREDPKGS} ca-certificates \
+ build-essential devscripts debhelper gcc make cmake
ARG mscpdir="/debbuild/mscp"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
# build
RUN cd ${mscpdir} \
&& debuild -us -uc -S \
diff --git a/Dockerfile/build-srpm.Dockerfile.in b/Dockerfile/build-srpm.Dockerfile
index f7a8cf0..b4ae974 100644
--- a/Dockerfile/build-srpm.Dockerfile.in
+++ b/Dockerfile/build-srpm.Dockerfile
@@ -1,16 +1,16 @@
FROM rockylinux:9
+ARG REQUIREDPKGS
+ARG MSCP_VERSION
+
# install pytest, sshd for test, and rpm-build
-RUN set -ex && yum -y install rpm-build rpmdevtools
+RUN set -ex && yum -y install ${REQUIREDPKGS} rpm-build rpmdevtools
-ARG mscpdir="/mscp-@MSCP_VERSION@"
-ARG mscptgz="mscp-@MSCP_VERSION@.tar.gz"
+ARG mscpdir="/mscp-${MSCP_VERSION}"
+ARG mscptgz="mscp-${MSCP_VERSION}.tar.gz"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
# prepare rpmbuild
RUN rpmdev-setuptree \
&& rm -rf ${mscpdir}/build \
diff --git a/Dockerfile/rocky-8.9.Dockerfile b/Dockerfile/rocky-8.9.Dockerfile
index df23d83..5a19699 100644
--- a/Dockerfile/rocky-8.9.Dockerfile
+++ b/Dockerfile/rocky-8.9.Dockerfile
@@ -1,8 +1,12 @@
FROM rockylinux:8.9
+ARG REQUIREDPKGS
+
# 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
+ ${REQUIREDPKGS} \
+ python3 python3-pip python3-devel \
+ openssh openssh-server openssh-clients rpm-build
RUN python3 -m pip install pytest
@@ -29,9 +33,6 @@ ARG mscpdir="/mscp"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
# build
RUN cd ${mscpdir} \
&& rm -rf build \
diff --git a/Dockerfile/rocky-9.3.Dockerfile b/Dockerfile/rocky-9.3.Dockerfile
index 225aafa..9c15d00 100644
--- a/Dockerfile/rocky-9.3.Dockerfile
+++ b/Dockerfile/rocky-9.3.Dockerfile
@@ -1,8 +1,12 @@
FROM rockylinux:9.3
+ARG REQUIREDPKGS
+
# 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
+ ${REQUIREDPKGS} \
+ python3 python3-pip python3-devel \
+ openssh openssh-server openssh-clients rpm-build
RUN python3 -m pip install pytest
@@ -28,9 +32,6 @@ ARG mscpdir="/mscp"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
# build
RUN cd ${mscpdir} \
&& rm -rf build \
diff --git a/Dockerfile/ubuntu-20.04.Dockerfile b/Dockerfile/ubuntu-20.04.Dockerfile
index 5a75295..669e9ab 100644
--- a/Dockerfile/ubuntu-20.04.Dockerfile
+++ b/Dockerfile/ubuntu-20.04.Dockerfile
@@ -1,16 +1,13 @@
FROM ubuntu:20.04
+ARG REQUIREDPKGS
+
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
- ca-certificates
-
-# install pytest, and sshd for test
-RUN apt-get install -y --no-install-recommends \
- python3 python3-pip python3-dev openssh-server
+ ${REQUIREDPKGS} ca-certificates python3 python3-pip python3-dev openssh-server
RUN python3 -m pip install pytest
-
# preparation for sshd
RUN mkdir /var/run/sshd \
&& ssh-keygen -A \
@@ -31,10 +28,6 @@ ARG mscpdir="/mscp"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
-
# build
RUN cd ${mscpdir} \
&& rm -rf build \
diff --git a/Dockerfile/ubuntu-22.04.Dockerfile b/Dockerfile/ubuntu-22.04.Dockerfile
index dff3f7f..3494d8b 100644
--- a/Dockerfile/ubuntu-22.04.Dockerfile
+++ b/Dockerfile/ubuntu-22.04.Dockerfile
@@ -1,16 +1,13 @@
FROM ubuntu:22.04
+ARG REQUIREDPKGS
+
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
- ca-certificates
-
-# install pytest, and sshd for test
-RUN apt-get install -y --no-install-recommends \
- python3 python3-pip python3-dev openssh-server
+ ${REQUIREDPKGS} ca-certificates python3 python3-pip python3-dev openssh-server
RUN python3 -m pip install pytest
-
# preparation for sshd
RUN mkdir /var/run/sshd \
&& ssh-keygen -A \
@@ -31,10 +28,6 @@ ARG mscpdir="/mscp"
COPY . ${mscpdir}
-# install build dependency
-RUN ${mscpdir}/scripts/install-build-deps.sh
-
-
# build
RUN cd ${mscpdir} \
&& rm -rf build \