mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +00:00 
			
		
		
		
	add all ci relevant tools to the build helper (#290)
also push the build helper into the docker hub Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
		
							parent
							
								
									ead0acfdb0
								
							
						
					
					
						commit
						3165430f72
					
				| @ -3,11 +3,12 @@ | ||||
| set -euo pipefail | ||||
| IFS=$'\n\t' | ||||
| 
 | ||||
| HADOLINT_VERSION=1.17.1 | ||||
| DOCKER_COMPOSE_VERSION=1.23.2 | ||||
| TRIVY_VERSION=0.1.1 | ||||
| GOSS_VERSION=0.3.7 | ||||
| COMMANDER_VERSION=1.2.1 | ||||
| DOCKER_COMPOSE_VERSION=1.23.2 | ||||
| GOSS_VERSION=0.3.7 | ||||
| HADOLINT_VERSION=1.17.1 | ||||
| REG_VERSION=0.16.1 | ||||
| TRIVY_VERSION=0.1.1 | ||||
| 
 | ||||
| progname=$(basename "$0") | ||||
| tempdir=$(mktemp -d "/tmp/$progname.XXXXXX") | ||||
| @ -53,6 +54,11 @@ if ! command -v dccommander > /dev/null; then | ||||
| 	sudo chmod +rx /usr/local/bin/dccommander | ||||
| fi | ||||
| 
 | ||||
| if ! command -v reg  > /dev/null; then | ||||
| 	sudo curl -L https://github.com/genuinetools/reg/releases/download/v$REG_VERSION/reg-linux-amd64 -o /usr/local/bin/reg | ||||
| 	sudo chmod +rx /usr/local/bin/reg | ||||
| fi | ||||
| 
 | ||||
| if ! command -v expect > /dev/null; then | ||||
| 	sudo apt update && sudo apt install -y expect | ||||
| fi | ||||
|  | ||||
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @ -114,6 +114,9 @@ build-base: ## Build new base image. | ||||
| build-core: | ||||
| 	component=core make build | ||||
| 
 | ||||
| build-helper: | ||||
| 	component=build make build-simple | ||||
| 
 | ||||
| build-konnect: | ||||
| 	component=konnect make build-simple | ||||
| 
 | ||||
| @ -285,6 +288,9 @@ publish-base: tag-base | ||||
| publish-core: tag-core | ||||
| 	component=core make publish-container | ||||
| 
 | ||||
| publish-helper: | ||||
| 	docker push $(docker_repo)/kopano_build:latest | ||||
| 
 | ||||
| publish-konnect: tag-konnect | ||||
| 	component=konnect make publish-container | ||||
| 
 | ||||
|  | ||||
| @ -1,12 +1,33 @@ | ||||
| FROM docker:18.09.6 | ||||
| ENV COMPOSE_VERSION "1.19.0" | ||||
| ENV REG_VERSION "0.16.0" | ||||
| RUN apk add --no-cache bash curl coreutils git expect make nano jq py-pip | ||||
| RUN pip install --no-cache-dir docker-compose==${COMPOSE_VERSION} | ||||
| # the 0.16.0 release of reg has a bug that breaks loading tags from the docker hub. | ||||
| # issue is fixed in master, but not in a release. | ||||
| # rel https://github.com/genuinetools/reg/issues/186 | ||||
| RUN curl -fSL "https://github.com/genuinetools/reg/releases/download/v$REG_VERSION/reg-linux-amd64" -o "/usr/local/bin/reg" \ | ||||
|     && chmod a+x "/usr/local/bin/reg" | ||||
| ENV \ | ||||
|     COMMANDER_VERSION=1.2.1 \ | ||||
|     COMPOSE_VERSION=1.19.0 \ | ||||
|     GOSS_VERSION=0.3.7 \ | ||||
|     HADOLINT_VERSION=1.17.1 \ | ||||
|     REG_VERSION=0.16.1 \ | ||||
|     TRIVY_VERSION=0.1.1 | ||||
| 
 | ||||
| LABEL maintainer=az@zok.xyz \ | ||||
|     org.label-schema.name="Kopano Container Builder" \ | ||||
|     org.label-schema.description="Helper Container to help building and testing containers" \ | ||||
|     org.label-schema.url="https://kopano.io" \ | ||||
|     org.label-schema.vcs-url="https://github.com/zokradonh/kopano-docker/build/" \ | ||||
|     org.label-schema.version=1.0.0 \ | ||||
|     org.label-schema.schema-version="1.0" | ||||
| 
 | ||||
| RUN apk add --no-cache bash curl coreutils git grep expect make nano npm jq py-pip && \ | ||||
|     apk add --no-cache shellcheck --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community | ||||
| 
 | ||||
| RUN curl -fSL "https://github.com/genuinetools/reg/releases/download/v$REG_VERSION/reg-linux-amd64" -o "/usr/local/bin/reg" && \ | ||||
|     curl -fSL "https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VERSION/hadolint-$(uname -s)-$(uname -m)" -o /usr/local/bin/hadolint && \ | ||||
|     curl -fSL "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \ | ||||
|     curl -fSL "https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64" -o /usr/local/bin/goss && \ | ||||
|     curl -L "https://raw.githubusercontent.com/fbartels/goss/dcgoss-v2/extras/dcgoss/dcgoss -o /usr/local/bin/dcgoss" && \ | ||||
|     curl -fSL "https://github.com/SimonBaeumer/commander/releases/download/v$COMMANDER_VERSION/commander-linux-amd64" -o /usr/local/bin/commander && \ | ||||
|     curl -fSL "https://raw.githubusercontent.com/fbartels/dccommander/master/dccommander" -o /usr/local/bin/dccommander && \ | ||||
|     pip install yamllint==1.19.0 && \ | ||||
|     npm install -g eclint@2.8.1 && \ | ||||
|     chmod a+x /usr/local/bin/* | ||||
| 
 | ||||
| WORKDIR /kopano-docker | ||||
| CMD ["bash"] | ||||
|  | ||||
| @ -5,11 +5,12 @@ fi | ||||
| 
 | ||||
| cd "$(dirname "$0")" || exit | ||||
| 
 | ||||
| docker build . | ||||
| docker pull zokradonh/kopano_build:latest || true | ||||
| docker build --cache-from zokradonh/kopano_build:latest . | ||||
| 
 | ||||
| docker run \ | ||||
| 	--rm -it \ | ||||
| 	-u "$(id -u)":"$(id -g)" \ | ||||
| 	-v /var/run/docker.sock:/var/run/docker.sock \ | ||||
| 	-v "$(pwd)"/..:/kopano-docker/ \ | ||||
| 	"$(docker build -q .)" "$@" | ||||
| 	"$(docker build --cache-from zokradonh/kopano_build:latest -q .)" "$@" | ||||
|  | ||||
| @ -4,7 +4,7 @@ set -euo pipefail | ||||
| IFS=$'\n\t' | ||||
| 
 | ||||
| if ! command -v reg > /dev/null; then | ||||
| 	echo "Please install reg to list available tags. You can only press enter when being asked for a tag." | ||||
| 	echo "Please install reg to list available tags. Until then please only press enter and don't enter a version number when being asked for a tag." | ||||
| fi | ||||
| 
 | ||||
| if [ ! -e ./.env ]; then | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user