mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-31 10:27:14 +00:00 
			
		
		
		
	enhance example for installing plugins at build time (#458)
* enhance example for installing plugins at build time Relates to https://github.com/zokradonh/kopano-docker/issues/457 * do not always rebuild the webapp base when building the webapp plugins image documentation
This commit is contained in:
		
							parent
							
								
									2c783d7256
								
							
						
					
					
						commit
						d3ef8b472a
					
				
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @ -187,11 +187,13 @@ build-webapp: build-php | |||||||
| 
 | 
 | ||||||
| build-webapp-demo: build-webapp ## Replaces the actual kopano_webapp container with one that has login hints for demo.kopano.com.
 | build-webapp-demo: build-webapp ## Replaces the actual kopano_webapp container with one that has login hints for demo.kopano.com.
 | ||||||
| 	docker build --rm \
 | 	docker build --rm \
 | ||||||
|  | 		--build-arg docker_repo=$(docker_repo) \
 | ||||||
| 		-f webapp/Dockerfile.demo \
 | 		-f webapp/Dockerfile.demo \
 | ||||||
| 		-t $(docker_repo)/kopano_webapp webapp/ | 		-t $(docker_repo)/kopano_webapp webapp/ | ||||||
| 
 | 
 | ||||||
| build-webapp-plugins: build-webapp ## Example for a custom image to install Kopano WebApp plugins
 | build-webapp-plugins: ## Example for a custom image to install Kopano WebApp plugins
 | ||||||
| 	docker build --rm \
 | 	docker build --rm \
 | ||||||
|  | 		--build-arg docker_repo=$(docker_repo) \
 | ||||||
| 		-f webapp/Dockerfile.plugins \
 | 		-f webapp/Dockerfile.plugins \
 | ||||||
| 		-t $(docker_repo)/kopano_webapp webapp/ | 		-t $(docker_repo)/kopano_webapp webapp/ | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
|  | # This Dockerfile can be built by running `make build-webapp-plugins` in the root of this project | ||||||
| ARG docker_repo=zokradonh | ARG docker_repo=zokradonh | ||||||
| FROM ${docker_repo}/kopano_webapp | FROM ${docker_repo}/kopano_webapp | ||||||
| 
 | 
 | ||||||
| @ -6,6 +7,28 @@ ENV \ | |||||||
|     KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER=kopano_zpush:9080 \ |     KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER=kopano_zpush:9080 \ | ||||||
|     KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER_SSL=false |     KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER_SSL=false | ||||||
| 
 | 
 | ||||||
|  | SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||||||
|  | 
 | ||||||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | RUN apt-get update && apt-get install -y --no-install-recommends \ | ||||||
|  |     "${ADDITIONAL_KOPANO_PACKAGES}" \ | ||||||
|  |     "${ADDITIONAL_KOPANO_WEBAPP_PLUGINS}" \ | ||||||
|  |     kopano-webapp-plugin-files \ | ||||||
|  |     kopano-webapp-plugin-filesbackend-owncloud \ | ||||||
|  |     kopano-webapp-plugin-intranet \ | ||||||
|     kopano-webapp-plugin-mdm \ |     kopano-webapp-plugin-mdm \ | ||||||
|  |     kopano-webapp-plugin-pimfolder \ | ||||||
|  |     kopano-webapp-plugin-smime \ | ||||||
|     && rm -rf /var/cache/apt /var/lib/apt/lists |     && rm -rf /var/cache/apt /var/lib/apt/lists | ||||||
|  | 
 | ||||||
|  | # tweak to make the container read-only | ||||||
|  | RUN mkdir -p /tmp/webapp/ && \ | ||||||
|  |     for i in /etc/kopano/webapp/* /etc/kopano/webapp/.[^.]*; do \ | ||||||
|  |         if [ -L "$i" ]; then \ | ||||||
|  |             continue; \ | ||||||
|  |         fi; \ | ||||||
|  |         if [[ "$i" = *.dist ]]; then \ | ||||||
|  |             continue; \ | ||||||
|  |         fi; \ | ||||||
|  |         mv -v "$i" "$i.dist"; \ | ||||||
|  |         ln -s /tmp/webapp/"$(basename "$i")" "$i"; \ | ||||||
|  |     done | ||||||
|  | |||||||
| @ -31,6 +31,7 @@ if [ "${AUTOCONFIGURE}" == true ]; then | |||||||
| 		echo "Notice: Container is run read-only, skipping package installation." | 		echo "Notice: Container is run read-only, skipping package installation." | ||||||
| 		echo "If you want to have additional packages installed in the container either:" | 		echo "If you want to have additional packages installed in the container either:" | ||||||
| 		echo "- build your own image with the packages already included" | 		echo "- build your own image with the packages already included" | ||||||
|  | 		echo "  - see https://github.com/zokradonh/kopano-docker/blob/master/webapp/Dockerfile.plugins for an example of such a Dockerfile" | ||||||
| 		echo "- switch the container to 'read_only: false'" | 		echo "- switch the container to 'read_only: false'" | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
| @ -52,7 +53,8 @@ if [ "${AUTOCONFIGURE}" == true ]; then | |||||||
| 	# fallback for plugins installed during runtime | 	# fallback for plugins installed during runtime | ||||||
| 	for i in /etc/kopano/webapp/*.php; do | 	for i in /etc/kopano/webapp/*.php; do | ||||||
| 		filename=$(basename -- "$i") | 		filename=$(basename -- "$i") | ||||||
| 		if [ "$filename" = config.php ]; then | 		# skip file if its already a symlink | ||||||
|  | 		if [ -L "$i" ]; then | ||||||
| 			continue | 			continue | ||||||
| 		fi | 		fi | ||||||
| 		mv -vn "$i" "/tmp/webapp/$filename" | 		mv -vn "$i" "/tmp/webapp/$filename" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user