mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +00:00 
			
		
		
		
	fail make target when docker wait returns with non zero output (#184)
just install python3-minimal in base clear apt key todo rework test-ci to fail when the test containers exits with error code != 1
This commit is contained in:
		
							parent
							
								
									aa2b8332dd
								
							
						
					
					
						commit
						adfbfeb4a3
					
				
							
								
								
									
										10
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile
									
									
									
									
									
								
							| @ -344,15 +344,13 @@ test: ## Build and start new containers for testing (also deletes existing data | ||||
| test-update-env: ## Recreate containers based on updated .env.
 | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) up -d | ||||
| 
 | ||||
| .PHONY: test-ci | ||||
| test-ci: ## Test if all containers start up
 | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml build | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml up -d | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml ps | ||||
| 	# TODO this just echos the exit code of the kopano_test container. if this is not 0 we should do something with it. | ||||
| 	docker wait kopano_test_1 | ||||
| 	docker logs --tail 10 kopano_test_1 | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) up -d | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) ps | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml run test || (docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml down -v; exit 1) | ||||
| 	docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml stop 2>/dev/null | ||||
| 	docker rm kopano_test_1 | ||||
| 
 | ||||
| test-security: ## Scan containers with Trivy for known security risks (not part of CI workflow for now).
 | ||||
| 	cat $(TAG_FILE) | xargs -I % sh -c 'trivy --exit-code 0 --severity HIGH --quiet --auto-refresh %' | ||||
|  | ||||
| @ -9,7 +9,7 @@ ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" | ||||
| ARG RELEASE_KEY_DOWNLOAD=0 | ||||
| ARG DEBIAN_FRONTEND=noninteractive | ||||
| 
 | ||||
| ENV BASE_VERSION=1.1.0 | ||||
| ENV BASE_VERSION=1.2.0 | ||||
| 
 | ||||
| LABEL maintainer=az@zok.xyz \ | ||||
|     org.label-schema.name="Kopano base container" \ | ||||
| @ -26,8 +26,6 @@ RUN mkdir -p /kopano/repo /kopano/data /kopano/helper /kopano/path | ||||
| WORKDIR /kopano/repo | ||||
| 
 | ||||
| # install basics | ||||
| # TODO require python3 or python3-minimal? | ||||
| # TODO install apt keys if supported kopano (instead of in core, php, meet, ...) | ||||
| # hadolint ignore=DL3005 | ||||
| RUN apt-get update && \ | ||||
|     apt-get upgrade -y && \ | ||||
| @ -41,18 +39,22 @@ RUN apt-get update && \ | ||||
|         jq \ | ||||
|         locales \ | ||||
|         moreutils \ | ||||
|         python3 \ | ||||
|         python3-minimal \ | ||||
|         && \ | ||||
|     rm -rf /var/cache/apt /var/lib/apt/lists/* | ||||
|     rm -rf /var/cache/apt /var/lib/apt/lists/*; \ | ||||
|     # install apt key if supported kopano | ||||
|     if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ | ||||
|         curl -s -S -o - "${KOPANO_CORE_REPOSITORY_URL}/Release.key" | apt-key add -; \ | ||||
|     fi | ||||
| 
 | ||||
| ENV DOCKERIZE_VERSION v0.6.1 | ||||
| RUN curl -L https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzvf - -C /usr/local/bin | ||||
| 
 | ||||
| RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | ||||
|     sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \ | ||||
|     dpkg-reconfigure --frontend=noninteractive locales && \ | ||||
|     update-locale LANG=en_US.UTF-8 | ||||
| 
 | ||||
| ENV DOCKERIZE_VERSION v0.6.1 | ||||
| RUN curl -L https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzvf - -C /usr/local/bin | ||||
| 
 | ||||
| # get common utilities | ||||
| COPY create-kopano-repo.sh /kopano/helper/ | ||||
| COPY kcconf.py /kopano/ | ||||
|  | ||||
| @ -36,11 +36,8 @@ RUN \ | ||||
|     if [ ${DOWNLOAD_COMMUNITY_PACKAGES} -eq 1 ]; then \ | ||||
|         dl_and_package_community "core"; \ | ||||
|     fi; \ | ||||
|     # apt key has already been installed in base | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \ | ||||
|     # install apt key if supported kopano | ||||
|     if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ | ||||
|         curl -s -S -o - "${KOPANO_CORE_REPOSITORY_URL}/Release.key" | apt-key add -; \ | ||||
|     fi; \ | ||||
|     # install | ||||
|     apt-get update && \ | ||||
|     set -x && \ | ||||
|  | ||||
| @ -238,7 +238,6 @@ services: | ||||
|   kopano_webapp: | ||||
|     image: ${docker_repo:-zokradonh}/kopano_webapp:${WEBAPP_VERSION:-latest} | ||||
|     hostname: kopano_webapp | ||||
|     container_name: ${COMPOSE_PROJECT_NAME}_webapp | ||||
|     depends_on: | ||||
|       - kopano_server | ||||
|     volumes: | ||||
|  | ||||
| @ -40,10 +40,6 @@ RUN \ | ||||
|         dl_and_package_community "meet"; \ | ||||
|     fi; \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_MEET_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \ | ||||
|     # install apt key if supported kopano | ||||
|     if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ | ||||
|         curl -s -S -o - "${KOPANO_MEET_REPOSITORY_URL}/Release.key" | apt-key add -; \ | ||||
|     fi; \ | ||||
|     # install | ||||
|     apt-get update && \ | ||||
|     set -x && \ | ||||
|  | ||||
| @ -38,10 +38,6 @@ RUN \ | ||||
|         dl_and_package_community "core"; \ | ||||
|     fi; \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \ | ||||
|     # install apt keys if supported kopano | ||||
|     if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ | ||||
|         curl -s -S -o - "${KOPANO_CORE_REPOSITORY_URL}/Release.key" | apt-key add -; \ | ||||
|     fi; \ | ||||
|     # install | ||||
|     set -x && \ | ||||
|     apt-get update && apt-get install -y --no-install-recommends \ | ||||
|  | ||||
| @ -29,7 +29,6 @@ LABEL maintainer=az@zok.xyz \ | ||||
| 
 | ||||
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||||
| 
 | ||||
| # add install common php dependencies | ||||
| # hadolint ignore=SC2129 | ||||
| RUN \ | ||||
|     # community download and package as apt source repository | ||||
| @ -38,10 +37,6 @@ RUN \ | ||||
|         dl_and_package_community "core"; \ | ||||
|     fi; \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \ | ||||
|     # install apt keys if supported kopano | ||||
|     if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ | ||||
|         curl -s -S -o - "${KOPANO_CORE_REPOSITORY_URL}/Release.key" | apt-key add -; \ | ||||
|     fi; \ | ||||
|     # install | ||||
|     set -x && \ | ||||
|     apt-get update && apt-get install -y --no-install-recommends \ | ||||
|  | ||||
| @ -56,10 +56,6 @@ RUN \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_WEBAPP_SMIME_REPOSITORY_URL} ./" >> /etc/apt/sources.list.d/kopano.list; \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_WEBAPP_MDM_REPOSITORY_URL} ./" >> /etc/apt/sources.list.d/kopano.list; \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_WEBAPP_FILES_REPOSITORY_URL} ./" >> /etc/apt/sources.list.d/kopano.list; \ | ||||
|     # install apt keys if supported kopano | ||||
|     if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ | ||||
|         curl -s -S -o - "${KOPANO_CORE_REPOSITORY_URL}/Release.key" | apt-key add -; \ | ||||
|     fi; \ | ||||
|     # install | ||||
|     set -x && \ | ||||
|     apt-get update && apt-get install -y --no-install-recommends \ | ||||
|  | ||||
| @ -43,6 +43,7 @@ RUN \ | ||||
|     echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \ | ||||
|     # prepare z-push installation | ||||
|     echo "deb ${KOPANO_ZPUSH_REPOSITORY_URL} /" > /etc/apt/sources.list.d/zpush.list && \ | ||||
|     # this is the same key as for the rest of the Kopano stack, making a separate download anyways as this may not be the case in the future  | ||||
|     curl -s -S -o - "${KOPANO_ZPUSH_REPOSITORY_URL}/Release.key" | apt-key add - && \ | ||||
|     # install | ||||
|     set -x && \ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user