diff options
author | Manuel Bentele | 2020-11-10 08:42:00 +0100 |
---|---|---|
committer | Manuel Bentele | 2020-11-10 08:42:00 +0100 |
commit | 0432a38299447eb236c7b1440d34ae9e655058b9 (patch) | |
tree | 3ad1ec0a3fd7995fb1166294649190f8518f2731 | |
parent | [CLIENT] display proper connected server if multiple servers specified (diff) | |
download | dnbd3-0432a38299447eb236c7b1440d34ae9e655058b9.tar.gz dnbd3-0432a38299447eb236c7b1440d34ae9e655058b9.tar.xz dnbd3-0432a38299447eb236c7b1440d34ae9e655058b9.zip |
[BUILD] build docker containers only if build of dnbd3-server is enabled
This patch fixes the issue that a Docker container for the dnbd3
components (including the dnbd3-server) can be built with missing
dnbd3-server's binary. Since the created Docker container starts
the missing binary, it will fail. Therefore, a built of the Docker
image is only possible if building of the dnbd3-server is enabled
(CMAKE option DNBD3_SERVER=ON).
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | README.md | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 219ec00..76f5190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,7 +194,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release) DEPENDS package_source_main) # include target to make docker image - if(NOT DNBD3_KERNEL_MODULE AND DNBD3_PACKAGE_DOCKER) + if(NOT DNBD3_KERNEL_MODULE AND DNBD3_SERVER AND DNBD3_PACKAGE_DOCKER) find_package(Docker REQUIRED) include(DockerImage) @@ -211,7 +211,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release) set(PACKAGE_FILE_ARCHLINUX ${CPACK_PACKAGE_NAME}_${REPOSITORY_VERSION_FULL}_${CMAKE_SYSTEM_PROCESSOR}.tar.gz) set(DOCKER_IMAGE_ARCHLINUX ${CPACK_PACKAGE_NAME}_${REPOSITORY_VERSION_FULL}_${CMAKE_SYSTEM_PROCESSOR}_archlinux_docker.tar) add_docker_image(docker-archlinux ${DOCKER_IMAGE_ARCHLINUX} ${DOCKER_FILE_ARCHLINUX} ${DOCKER_TAG} ${PACKAGE_FILE_ARCHLINUX} ${CMAKE_BINARY_DIR}) - endif(NOT DNBD3_KERNEL_MODULE AND DNBD3_PACKAGE_DOCKER) + endif(NOT DNBD3_KERNEL_MODULE AND DNBD3_SERVER AND DNBD3_PACKAGE_DOCKER) endif(CMAKE_BUILD_TYPE MATCHES Release) # add all dnbd3 related projects from the source code directory @@ -147,12 +147,13 @@ This target creates compressed archives (\*_source.tar.gz and \*_source.zip) con ### Docker image -A docker image of the built dnbd3 components can be created in the `Release` build configuration with the option `DNBD3_PACKAGE_DOCKER=ON` and `DNBD3_KERNEL_MODULE=OFF`. The image is based on Ubuntu 20.04 and a created docker container from it starts the embedded dnbd3-server automatically. +A docker image of the built dnbd3 components can be created in the `Release` build configuration with the option `DNBD3_PACKAGE_DOCKER=ON`, `DNBD3_SERVER=ON` and `DNBD3_KERNEL_MODULE=OFF`. The image is based on Ubuntu 20.04 and a created docker container from it starts the embedded dnbd3-server automatically. -Before the image is built, make sure that your docker daemon runs and you are a member of the `docker` group to access the docker deamon without any super user privileges. Then, build the docker image by calling the following Make target: +Before the image is built, make sure that your docker daemon runs and you are a member of the `docker` group to access the docker deamon without any super user privileges. Then, build the docker image based on either Ubuntu 20.04 or Archlinux by calling one of the following Make target: ``` make docker-ubuntu-20-04 +make docker-archlinux ``` The built docker image is saved as archive file (\*_ubuntu-20-04_docker.tar) and can be deployed to other machines. On each machine, the created image can be loaded with the following docker client call: |