add docker files

This commit is contained in:
Ryo Nakamura
2022-10-30 23:37:10 +09:00
parent 6f37260411
commit 548565d888
5 changed files with 63 additions and 0 deletions

1
docker/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.deb

View File

@@ -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

View File

@@ -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

View File

@@ -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

18
docker/README.md Normal file
View File

@@ -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.