summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/.gitignore1
-rw-r--r--docker/Dockerfile-centos-818
-rw-r--r--docker/Dockerfile-ubuntu-20.0413
-rw-r--r--docker/Dockerfile-ubuntu-22.0413
-rw-r--r--docker/README.md18
5 files changed, 63 insertions, 0 deletions
diff --git a/docker/.gitignore b/docker/.gitignore
new file mode 100644
index 0000000..c00df13
--- /dev/null
+++ b/docker/.gitignore
@@ -0,0 +1 @@
+*.deb
diff --git a/docker/Dockerfile-centos-8 b/docker/Dockerfile-centos-8
new file mode 100644
index 0000000..7c80119
--- /dev/null
+++ b/docker/Dockerfile-centos-8
@@ -0,0 +1,18 @@
+FROM centos:8
+
+ARG DEBIAN_FRONTEND=noninteractive
+ARG workdir="/"
+
+# 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-*
+
+RUN set -ex && yum -y update && yum -y install \
+ git cmake gcc make libssh-devel rpm-build
+
+RUN cd ${workdir} \
+ && git clone --depth=1 https://github.com/upa/mscp \
+ && mkdir mscp/build && cd mscp/build \
+ && cmake .. -DBUILD_PKG=1 \
+ && cpack -G RPM CPackConfig.cmake
diff --git a/docker/Dockerfile-ubuntu-20.04 b/docker/Dockerfile-ubuntu-20.04
new file mode 100644
index 0000000..d48d4f1
--- /dev/null
+++ b/docker/Dockerfile-ubuntu-20.04
@@ -0,0 +1,13 @@
+FROM ubuntu:20.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+ARG workdir="/"
+
+RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
+ git cmake build-essential libssh-dev ca-certificates
+
+RUN cd ${workdir} \
+ && git clone --depth=1 https://github.com/upa/mscp \
+ && mkdir mscp/build && cd mscp/build \
+ && cmake .. -DBUILD_PKG=1 \
+ && cpack -G DEB CPackConfig.cmake
diff --git a/docker/Dockerfile-ubuntu-22.04 b/docker/Dockerfile-ubuntu-22.04
new file mode 100644
index 0000000..eb89243
--- /dev/null
+++ b/docker/Dockerfile-ubuntu-22.04
@@ -0,0 +1,13 @@
+FROM ubuntu:22.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+ARG workdir="/"
+
+RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
+ git cmake build-essential libssh-dev ca-certificates
+
+RUN cd ${workdir} \
+ && git clone --depth=1 https://github.com/upa/mscp \
+ && mkdir mscp/build && cd mscp/build \
+ && cmake .. -DBUILD_PKG=1 \
+ && cpack -G DEB CPackConfig.cmake
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 0000000..07279c3
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,18 @@
+
+Build `mscp` in docker containers.
+
+```console
+docker build -t mscp-ubuntu:20.04 -f Dockerfile-ubuntu-20.04 .
+docker run -it --rm -v (pwd):/out mscp-ubuntu:20.04 \
+ cp /mscp/build/mscp_0.0.0-ubuntu-20.04-x86_64.deb /out/
+
+docker build -t mscp-ubuntu:22.04 -f Dockerfile-ubuntu-22.04 .
+docker run -it --rm -v (pwd):/out mscp-ubuntu:22.04 \
+ cp /mscp/build/mscp_0.0.0-ubuntu-22.04-x86_64.deb /out/
+
+docker build -t mscp-centos:8 -f Dockerfile-centos-8 .
+docker run -it --rm -v (pwd):/out mscp-centos:8 \
+ cp /mscp/build/mscp_0.0.0-centos-8-x86_64.rpm /out/
+```
+
+I don't know whether this is a good way. \ No newline at end of file