From 2ac947f4ec8a34a6c302a76260f646b36a2078b1 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 2 Nov 2020 09:44:34 +0100 Subject: [BUILD] add CMake support to build docker images based on Archlinux --- pkg/docker/Dockerfile | 28 ---------------------------- pkg/docker/archlinux_dockerfile | 28 ++++++++++++++++++++++++++++ pkg/docker/ubuntu-20-04_dockerfile | 28 ++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 28 deletions(-) delete mode 100644 pkg/docker/Dockerfile create mode 100644 pkg/docker/archlinux_dockerfile create mode 100644 pkg/docker/ubuntu-20-04_dockerfile (limited to 'pkg') diff --git a/pkg/docker/Dockerfile b/pkg/docker/Dockerfile deleted file mode 100644 index ad2adcb..0000000 --- a/pkg/docker/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# use Ubuntu 20.04 as base image -FROM ubuntu:focal - -# declare arguments that should be set by 'docker build --build-arg ...' -ARG DNBD3_PACKAGE_FILE_NAME - -# copy built package file from host to docker image -COPY ${DNBD3_PACKAGE_FILE_NAME} /tmp - -# install required dependencies -RUN apt-get update -RUN apt-get install -y libfuse2 libjansson4 - -# install installation package -RUN dpkg -i /tmp/${DNBD3_PACKAGE_FILE_NAME} - -# use default config for dnbd3-server -RUN ln -s /etc/dnbd3-server/sample/server.conf /etc/dnbd3-server -RUN ln -s /etc/dnbd3-server/sample/alt-servers /etc/dnbd3-server - -# make default storage point for dnbd3-server -RUN mkdir -p /mnt/storage - -# expose the port of the dnbd3-server to the host -EXPOSE 5003 - -# run dnbd3-server -CMD [ "dnbd3-server", "-n" ] diff --git a/pkg/docker/archlinux_dockerfile b/pkg/docker/archlinux_dockerfile new file mode 100644 index 0000000..ea6145b --- /dev/null +++ b/pkg/docker/archlinux_dockerfile @@ -0,0 +1,28 @@ +# use Archlinux as base image +FROM archlinux:latest + +# declare arguments that should be set by 'docker build --build-arg ...' +ARG DNBD3_PACKAGE_FILE_NAME + +# copy built package file from host to docker image +COPY ${DNBD3_PACKAGE_FILE_NAME} /tmp + +# install required dependencies +RUN pacman --noconfirm -Sy +RUN pacman --noconfirm -S fuse2 jansson + +# install installation package +RUN tar -xf /tmp/${DNBD3_PACKAGE_FILE_NAME} --strip-components=1 -C / + +# use default config for dnbd3-server +RUN ln -s /etc/dnbd3-server/sample/server.conf /etc/dnbd3-server +RUN ln -s /etc/dnbd3-server/sample/alt-servers /etc/dnbd3-server + +# make default storage point for dnbd3-server +RUN mkdir -p /mnt/storage + +# expose the port of the dnbd3-server to the host +EXPOSE 5003 + +# run dnbd3-server +CMD [ "dnbd3-server", "-n" ] diff --git a/pkg/docker/ubuntu-20-04_dockerfile b/pkg/docker/ubuntu-20-04_dockerfile new file mode 100644 index 0000000..ad2adcb --- /dev/null +++ b/pkg/docker/ubuntu-20-04_dockerfile @@ -0,0 +1,28 @@ +# use Ubuntu 20.04 as base image +FROM ubuntu:focal + +# declare arguments that should be set by 'docker build --build-arg ...' +ARG DNBD3_PACKAGE_FILE_NAME + +# copy built package file from host to docker image +COPY ${DNBD3_PACKAGE_FILE_NAME} /tmp + +# install required dependencies +RUN apt-get update +RUN apt-get install -y libfuse2 libjansson4 + +# install installation package +RUN dpkg -i /tmp/${DNBD3_PACKAGE_FILE_NAME} + +# use default config for dnbd3-server +RUN ln -s /etc/dnbd3-server/sample/server.conf /etc/dnbd3-server +RUN ln -s /etc/dnbd3-server/sample/alt-servers /etc/dnbd3-server + +# make default storage point for dnbd3-server +RUN mkdir -p /mnt/storage + +# expose the port of the dnbd3-server to the host +EXPOSE 5003 + +# run dnbd3-server +CMD [ "dnbd3-server", "-n" ] -- cgit v1.2.3-55-g7522