summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-03-12 20:37:57 +0900
committerRyo Nakamura <upa@haeena.net>2023-03-12 20:37:57 +0900
commite2da5811ce2c9006ecb4319d8b1c40128ac2ff67 (patch)
tree537e53bd38af01766c250bfdb0c48bd0dd722d29 /docker
parent597a7a8cbae48a4f1026d6970e78b43b157bc70b (diff)
test: add test_python.py for testing python-mscp
Dockerfiles also adapt themselvs for testing python-mscp bindings.
Diffstat (limited to 'docker')
-rw-r--r--docker/alpine-3.17.Dockerfile14
-rw-r--r--docker/centos-8.Dockerfile5
-rw-r--r--docker/rocky-8.6.Dockerfile6
-rw-r--r--docker/ubuntu-20.04.Dockerfile6
-rw-r--r--docker/ubuntu-22.04.Dockerfile7
5 files changed, 32 insertions, 6 deletions
diff --git a/docker/alpine-3.17.Dockerfile b/docker/alpine-3.17.Dockerfile
index bf5679e..d2c899b 100644
--- a/docker/alpine-3.17.Dockerfile
+++ b/docker/alpine-3.17.Dockerfile
@@ -21,10 +21,11 @@ RUN cd ${mscpdir} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \
- -DBUILD_STATIC=ON -DBUILD_CONAN=ON \
+ -DBUILD_CONAN=ON -DBUILD_STATIC=ON \
&& make \
&& cp mscp /usr/bin/ \
- && cp mscp /mscp/build/mscp_0.0.6-alpine-3.17-x86_64.static
+ && cp mscp /mscp/build/mscp_$(cat ${mscpdir}/VERSION)-alpine-3.17-x86_64.static \
+ && cp mscp /mscp/build/mscp.linux.x86.static
# copy mscp to PKG FILE NAME because this build doesn't use CPACK
@@ -33,3 +34,12 @@ 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
+
+# Need Fix: A trick putting libmscp.so to python mscp module dir does not work on alpine,
+# so install libmscp.
+RUN cd ${mscpdir}/build \
+ && make install
diff --git a/docker/centos-8.Dockerfile b/docker/centos-8.Dockerfile
index d9a4f20..3059715 100644
--- a/docker/centos-8.Dockerfile
+++ b/docker/centos-8.Dockerfile
@@ -11,7 +11,7 @@ RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|
# install pytest, sshd for test, and rpm-build
RUN set -ex && yum -y update && yum -y install \
- python3 python3-pip openssh openssh-server openssh-clients rpm-build
+ python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build
RUN python3 -m pip install pytest
@@ -34,3 +34,6 @@ RUN cd ${mscpdir} \
&& 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
index abb2cf5..35d18a8 100644
--- a/docker/rocky-8.6.Dockerfile
+++ b/docker/rocky-8.6.Dockerfile
@@ -6,7 +6,7 @@ COPY . ${mscpdir}
# install pytest, sshd for test, and rpm-build
RUN set -ex && yum -y install \
- python3 python3-pip openssh openssh-server openssh-clients rpm-build
+ python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build
RUN python3 -m pip install pytest
@@ -29,3 +29,7 @@ RUN cd ${mscpdir} \
&& 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 e1dac03..d00f7c8 100644
--- a/docker/ubuntu-20.04.Dockerfile
+++ b/docker/ubuntu-20.04.Dockerfile
@@ -10,7 +10,7 @@ RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
# install pytest, and sshd for test
RUN apt-get install -y --no-install-recommends \
- python3 python3-pip openssh-server
+ python3 python3-pip python3-dev openssh-server
RUN python3 -m pip install pytest
@@ -33,3 +33,7 @@ RUN cd ${mscpdir} \
&& make \
&& cpack -G DEB CPackConfig.cmake \
&& dpkg -i *.deb
+
+# install mscp python module
+RUN cd ${mscpdir} \
+ && python3 setup.py install --user
diff --git a/docker/ubuntu-22.04.Dockerfile b/docker/ubuntu-22.04.Dockerfile
index 26ba009..e2c6f47 100644
--- a/docker/ubuntu-22.04.Dockerfile
+++ b/docker/ubuntu-22.04.Dockerfile
@@ -10,7 +10,7 @@ RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
# install pytest, and sshd for test
RUN apt-get install -y --no-install-recommends \
- python3 python3-pip openssh-server
+ python3 python3-pip python3-dev openssh-server
RUN python3 -m pip install pytest
@@ -33,3 +33,8 @@ RUN cd ${mscpdir} \
&& make \
&& cpack -G DEB CPackConfig.cmake \
&& dpkg -i *.deb
+
+# install mscp python module
+RUN cd ${mscpdir} \
+ && python3 setup.py install --user
+