mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
add docker files
This commit is contained in:
1
docker/.gitignore
vendored
Normal file
1
docker/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.deb
|
||||
18
docker/Dockerfile-centos-8
Normal file
18
docker/Dockerfile-centos-8
Normal 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
|
||||
13
docker/Dockerfile-ubuntu-20.04
Normal file
13
docker/Dockerfile-ubuntu-20.04
Normal 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
|
||||
13
docker/Dockerfile-ubuntu-22.04
Normal file
13
docker/Dockerfile-ubuntu-22.04
Normal 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
18
docker/README.md
Normal 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.
|
||||
Reference in New Issue
Block a user