mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +00:00 
			
		
		
		
	build fixes and readme improvements (#85)
* add compose to the build image * update readme * fine tuning for build container * directly pass commands to run script in build env * fix dockerfile so that everything can be build on Docker version 17.05.0-ce, build 9f07f0e-synology
This commit is contained in:
		
							parent
							
								
									6c70d11108
								
							
						
					
					
						commit
						6a14fbe174
					
				| @ -94,9 +94,9 @@ To get a quick impression of Kopano this git repository bundles a locally build | |||||||
| - Destroy local containers and network interfaces: `docker-compose down` | - Destroy local containers and network interfaces: `docker-compose down` | ||||||
| - Destroy volumes as well (will completely reset the containers, **deletes all data**): `docker-compose down -v` | - Destroy volumes as well (will completely reset the containers, **deletes all data**): `docker-compose down -v` | ||||||
| - Run commands in a running container: `docker-compose exec kopano_server kopano-cli --list-users` | - Run commands in a running container: `docker-compose exec kopano_server kopano-cli --list-users` | ||||||
| - Get logs of a container running in the background: `docker-compose logs -f kopano_server` | - Get logs of a in the background running container: `docker-compose logs -f kopano_server` | ||||||
| - Run a `kopano-backup`: `docker run -it -v /var/run/kopano/:/var/run/kopano -v $(pwd):/kopano/path zokradonh/kopano_utils kopano-backup` | - Run a `kopano-backup`: `docker run --rm -it -v /var/run/kopano/:/var/run/kopano -v $(pwd):/kopano/path zokradonh/kopano_utils kopano-backup` | ||||||
| - Get a shell in a new container to for example run `kopano-migration-pst`: `docker run -it -v /var/run/kopano/:/var/run/kopano -v $(pwd):/kopano/path zokradonh/kopano_utils` (to directly run kopano-migration-pst just append it to the command) | - Get a shell in a new container to (for example) run `kopano-migration-pst`: `docker run --rm -it -v /var/run/kopano/:/var/run/kopano -v $(pwd):/kopano/path zokradonh/kopano_utils` (to directly run kopano-migration-pst just append it to the command) | ||||||
| 
 | 
 | ||||||
| ## Third party docker images | ## Third party docker images | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
| FROM docker:18.09.0 | FROM docker:18.09.1 | ||||||
| RUN apk add bash curl expect make nano jq | ENV COMPOSE_VERSION "1.23.2" | ||||||
|  | RUN apk add bash curl expect make nano jq py-pip | ||||||
|  | RUN pip install --no-cache-dir docker-compose==${COMPOSE_VERSION} | ||||||
| WORKDIR /kopano-docker | WORKDIR /kopano-docker | ||||||
| CMD ["bash"] | CMD ["bash"] | ||||||
|  | |||||||
| @ -1,13 +1,18 @@ | |||||||
| Helper container for systems where build requirements (bash, curl, jq, make) are not available (for example on Synology) | # Minimal build environment | ||||||
|  | 
 | ||||||
|  | Helper container for systems where build requirements (bash, curl, docker-compose, jq, make) are not available (for example on Synology) | ||||||
| 
 | 
 | ||||||
| Run the following command to enter the "build environment" (command may need to be run with `sudo` to work with the `docker` command): | Run the following command to enter the "build environment" (command may need to be run with `sudo` to work with the `docker` command): | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| $ ./run.sh | $ ./run.sh | ||||||
|  | This script may need to be run as root to be able to use docker/docker-compose through it. | ||||||
| bash-4.4$ | bash-4.4$ | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | (the first time it will take a moment before the bash prompt is displayed, since the container is built locally first) | ||||||
|  | 
 | ||||||
| Afterwards you can execute the `setup.sh` script, modify `.env` to your liking and run any make commands: | Afterwards you can execute the `setup.sh` script, modify `.env` to your liking and run any make commands: | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| @ -63,4 +68,4 @@ Sending build context to Docker daemon  4.608kB | |||||||
| [...] | [...] | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| After exiting the container run `docker-compose up -d`, which will have the images started you previously built. | This container also includes ´docker-compose´ for systems that can not be easily updated (again Synology). You can freely choose to use ´docker-compose up -d´ from inside of outside of this container. | ||||||
|  | |||||||
| @ -1,8 +1,10 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  | if [ ! $(id -u) -eq 0 ]; then | ||||||
|  | 	echo "This script may need to be run as root to be able to use docker/docker-compose through it." | ||||||
|  | fi | ||||||
| docker run \ | docker run \ | ||||||
| 	--rm -it \ | 	--rm -it \ | ||||||
| 	-u $(id -u ${USER}):$(id -g ${USER}) \ | 	-u $(id -u ${USER}):$(id -g ${USER}) \ | ||||||
| 	-v /var/run/docker.sock:/var/run/docker.sock \ | 	-v /var/run/docker.sock:/var/run/docker.sock \ | ||||||
| 	-v ${PWD}/..:/kopano-docker/ \ | 	-v ${PWD}/..:/kopano-docker/ \ | ||||||
| 	$(docker build -q .) | 	$(docker build -q .) $@ | ||||||
| 
 |  | ||||||
|  | |||||||
| @ -4,11 +4,17 @@ FROM ${docker_repo}/kopano_base | |||||||
| ARG DEBIAN_FRONTEND=noninteractive | ARG DEBIAN_FRONTEND=noninteractive | ||||||
| 
 | 
 | ||||||
| ARG ADDITIONAL_KOPANO_PACKAGES="" | ARG ADDITIONAL_KOPANO_PACKAGES="" | ||||||
|  | ENV ADDITIONAL_KOPANO_PACKAGES=$ADDITIONAL_KOPANO_PACKAGES | ||||||
| ARG DOWNLOAD_COMMUNITY_PACKAGES=1 | ARG DOWNLOAD_COMMUNITY_PACKAGES=1 | ||||||
|  | ENV DOWNLOAD_COMMUNITY_PACKAGES=$DOWNLOAD_COMMUNITY_PACKAGES | ||||||
| ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" | ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" | ||||||
|  | ENV KOPANO_CORE_REPOSITORY_URL=$KOPANO_CORE_REPOSITORY_URL | ||||||
| ARG KOPANO_CORE_VERSION=newest | ARG KOPANO_CORE_VERSION=newest | ||||||
|  | ENV KOPANO_CORE_VERSION=$KOPANO_CORE_VERSION | ||||||
| ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ||||||
|  | ENV KOPANO_REPOSITORY_FLAGS=$KOPANO_REPOSITORY_FLAGS | ||||||
| ARG RELEASE_KEY_DOWNLOAD=0 | ARG RELEASE_KEY_DOWNLOAD=0 | ||||||
|  | ENV RELEASE_KEY_DOWNLOAD=$RELEASE_KEY_DOWNLOAD | ||||||
| 
 | 
 | ||||||
| # install Kopano Core and refresh ca-certificates | # install Kopano Core and refresh ca-certificates | ||||||
| RUN \ | RUN \ | ||||||
|  | |||||||
| @ -4,22 +4,35 @@ FROM ${docker_repo}/kopano_base | |||||||
| ARG DEBIAN_FRONTEND=noninteractive | ARG DEBIAN_FRONTEND=noninteractive | ||||||
| 
 | 
 | ||||||
| ARG ADDITIONAL_KOPANO_PACKAGES="" | ARG ADDITIONAL_KOPANO_PACKAGES="" | ||||||
|  | ENV ADDITIONAL_KOPANO_PACKAGES=$ADDITIONAL_KOPANO_PACKAGES | ||||||
| ARG ADDITIONAL_KOPANO_WEBAPP_PLUGINS="" | ARG ADDITIONAL_KOPANO_WEBAPP_PLUGINS="" | ||||||
|  | ENV ADDITIONAL_KOPANO_WEBAPP_PLUGINS=$ADDITIONAL_KOPANO_WEBAPP_PLUGINS | ||||||
| ARG DOWNLOAD_COMMUNITY_PACKAGES=1 | ARG DOWNLOAD_COMMUNITY_PACKAGES=1 | ||||||
|  | ENV DOWNLOAD_COMMUNITY_PACKAGES=$DOWNLOAD_COMMUNITY_PACKAGES | ||||||
| ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" | ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" | ||||||
|  | ENV KOPANO_CORE_REPOSITORY_URL=$KOPANO_CORE_REPOSITORY_URL | ||||||
| ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ||||||
|  | ENV KOPANO_REPOSITORY_FLAGS=$KOPANO_REPOSITORY_FLAGS | ||||||
| ARG KOPANO_WEBAPP_REPOSITORY_URL="file:/kopano/repo/webapp" | ARG KOPANO_WEBAPP_REPOSITORY_URL="file:/kopano/repo/webapp" | ||||||
|  | ENV KOPANO_WEBAPP_REPOSITORY_URL=$KOPANO_WEBAPP_REPOSITORY_URL | ||||||
| ARG KOPANO_WEBAPP_SMIME_REPOSITORY_URL="file:/kopano/repo/smime" | ARG KOPANO_WEBAPP_SMIME_REPOSITORY_URL="file:/kopano/repo/smime" | ||||||
|  | ENV KOPANO_WEBAPP_SMIME_REPOSITORY_URL=$KOPANO_WEBAPP_SMIME_REPOSITORY_URL | ||||||
| ARG KOPANO_WEBAPP_MDM_REPOSITORY_URL="file:/kopano/repo/mdm" | ARG KOPANO_WEBAPP_MDM_REPOSITORY_URL="file:/kopano/repo/mdm" | ||||||
|  | ENV KOPANO_WEBAPP_MDM_REPOSITORY_URL=$KOPANO_WEBAPP_MDM_REPOSITORY_URL | ||||||
| ARG KOPANO_WEBAPP_FILES_REPOSITORY_URL="file:/kopano/repo/files" | ARG KOPANO_WEBAPP_FILES_REPOSITORY_URL="file:/kopano/repo/files" | ||||||
|  | ENV KOPANO_WEBAPP_FILES_REPOSITORY_URL=$KOPANO_WEBAPP_FILES_REPOSITORY_URL | ||||||
| ARG KOPANO_CORE_VERSION=newest | ARG KOPANO_CORE_VERSION=newest | ||||||
|  | ENV KOPANO_CORE_VERSION=$KOPANO_CORE_VERSION | ||||||
| ARG KOPANO_WEBAPP_VERSION=newest | ARG KOPANO_WEBAPP_VERSION=newest | ||||||
|  | ENV KOPANO_WEBAPP_VERSION=$KOPANO_WEBAPP_VERSION | ||||||
| ARG KOPANO_WEBAPP_FILES_VERSION=newest | ARG KOPANO_WEBAPP_FILES_VERSION=newest | ||||||
|  | ENV KOPANO_WEBAPP_FILES_VERSION=$KOPANO_WEBAPP_FILES_VERSION | ||||||
| ARG KOPANO_WEBAPP_MDM_VERSION=newest | ARG KOPANO_WEBAPP_MDM_VERSION=newest | ||||||
|  | ENV KOPANO_WEBAPP_MDM_VERSION=$KOPANO_WEBAPP_MDM_VERSION | ||||||
| ARG KOPANO_WEBAPP_SMIME_VERSION=newest | ARG KOPANO_WEBAPP_SMIME_VERSION=newest | ||||||
|  | ENV KOPANO_WEBAPP_SMIME_VERSION=$KOPANO_WEBAPP_SMIME_VERSION | ||||||
| ARG RELEASE_KEY_DOWNLOAD=0 | ARG RELEASE_KEY_DOWNLOAD=0 | ||||||
| 
 | ENV RELEASE_KEY_DOWNLOAD=$RELEASE_KEY_DOWNLOAD | ||||||
| ENV ADDITIONAL_KOPANO_WEBAPP_PLUGINS="" |  | ||||||
| 
 | 
 | ||||||
| # install Kopano WebApp and refresh ca-certificates | # install Kopano WebApp and refresh ca-certificates | ||||||
| RUN \ | RUN \ | ||||||
|  | |||||||
| @ -4,13 +4,21 @@ FROM ${docker_repo}/kopano_base | |||||||
| ARG DEBIAN_FRONTEND=noninteractive | ARG DEBIAN_FRONTEND=noninteractive | ||||||
| 
 | 
 | ||||||
| ARG ADDITIONAL_KOPANO_PACKAGES="" | ARG ADDITIONAL_KOPANO_PACKAGES="" | ||||||
|  | ENV ADDITIONAL_KOPANO_PACKAGES=$ADDITIONAL_KOPANO_PACKAGES | ||||||
| ARG DOWNLOAD_COMMUNITY_PACKAGES=1 | ARG DOWNLOAD_COMMUNITY_PACKAGES=1 | ||||||
|  | ENV DOWNLOAD_COMMUNITY_PACKAGES=$DOWNLOAD_COMMUNITY_PACKAGES | ||||||
| ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" | ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" | ||||||
|  | ENV KOPANO_CORE_REPOSITORY_URL=$KOPANO_CORE_REPOSITORY_URL | ||||||
| ARG KOPANO_ZPUSH_REPOSITORY_URL="http://repo.z-hub.io/z-push:/final/Debian_9.0/" | ARG KOPANO_ZPUSH_REPOSITORY_URL="http://repo.z-hub.io/z-push:/final/Debian_9.0/" | ||||||
|  | ENV KOPANO_ZPUSH_REPOSITORY_URL=$KOPANO_ZPUSH_REPOSITORY_URL | ||||||
| ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ||||||
|  | ENV KOPANO_REPOSITORY_FLAGS=$KOPANO_REPOSITORY_FLAGS | ||||||
| ARG KOPANO_CORE_VERSION=newest | ARG KOPANO_CORE_VERSION=newest | ||||||
|  | ENV KOPANO_CORE_VERSION=$KOPANO_CORE_VERSION | ||||||
| ARG KOPANO_ZPUSH_VERSION=newest | ARG KOPANO_ZPUSH_VERSION=newest | ||||||
|  | ENV KOPANO_ZPUSH_VERSION=$KOPANO_ZPUSH_VERSION | ||||||
| ARG RELEASE_KEY_DOWNLOAD=0 | ARG RELEASE_KEY_DOWNLOAD=0 | ||||||
|  | ENV RELEASE_KEY_DOWNLOAD=$RELEASE_KEY_DOWNLOAD | ||||||
| 
 | 
 | ||||||
| # install Kopano WebApp and refresh ca-certificates | # install Kopano WebApp and refresh ca-certificates | ||||||
| RUN \ | RUN \ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user