Compare commits
	
		
			3 Commits
		
	
	
		
			3fa4c2240c
			...
			0a4f669d85
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0a4f669d85 | |||
| ae13fa5c9c | |||
| f42f7168d2 | 
@@ -20,14 +20,22 @@ When everything's ready start Zabbix with Docker Compose, otherwise head down to
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Define variables assuming the official Zabbix Docker repo lives at `/opt/git/github.com/zabbix/zabbix-docker/branches/latest`:
 | 
					Define variables assuming the official Zabbix Docker repo lives at `/opt/git/github.com/zabbix/zabbix-docker/branches/latest`:
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
export COMPOSE_DIR='/opt/git/github.com/zabbix/zabbix-docker/branches/latest'
 | 
					export UPSTREAM_REPO_DIR='/opt/git/github.com/zabbix/zabbix-docker/branches/latest'
 | 
				
			||||||
export COMPOSE_FILE="${COMPOSE_DIR}"'/docker-compose_v3_alpine_pgsql_latest.yaml'
 | 
					export UPSTREAM_REPO_TAG='6.4.2'
 | 
				
			||||||
 | 
					export UPSTREAM_COMPOSE_FILE="${UPSTREAM_REPO_DIR%/}"'/docker-compose_v3_alpine_pgsql_latest.yaml'
 | 
				
			||||||
 | 
					export COMPOSE_CTX='loft'
 | 
				
			||||||
 | 
					export COMPOSE_PROJECT_NAME='zabbixserver-'"${COMPOSE_CTX}"
 | 
				
			||||||
export COMPOSE_ENV_FILE=<add accordingly>
 | 
					export COMPOSE_ENV_FILE=<add accordingly>
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Pull newest image versions:
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					docker compose --project-name "${COMPOSE_PROJECT_NAME}" --file "${UPSTREAM_COMPOSE_FILE}" --env-file "${COMPOSE_ENV_FILE}" pull
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Run Zabbix like so
 | 
					Run Zabbix like so
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
docker compose --file "${COMPOSE_FILE}" --env-file "${COMPOSE_ENV_FILE}" up --detach
 | 
					docker compose --project-name "${COMPOSE_PROJECT_NAME}" --file "${UPSTREAM_COMPOSE_FILE}" --env-file "${COMPOSE_ENV_FILE}" up --detach
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Additional files
 | 
					## Additional files
 | 
				
			||||||
@@ -88,16 +96,17 @@ git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' pull
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Pick and checkout new tag
 | 
					Pick and checkout new tag
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
while IFS= read -r tag; do printf -- '%s %s\n' "$(git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' rev-list -n 1 'refs/tags/'"${tag}")" "${tag}"; done < <(git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' --no-pager tag --list --sort=v:refname)
 | 
					pushd '/opt/git/github.com/zabbix/zabbix-docker/branches/latest'
 | 
				
			||||||
 | 
					while IFS= read -r; do commitDate=$(grep -Pio '^.+?(?=[[:space:]])' <<< "${REPLY}"); commitDate=$(date --date='@'"${commitDate}" +%F-%H%M%S); tagRef="$(cut -d $'\t' -f2 <<< "${REPLY}")"; tagName="$(grep -Pio '(?<=refs/tags/)[^\r\n\f]+' <<<"${tagRef}")"; commitHash="$(git rev-list -n 1 "${tagRef}")"; echo "${commitDate} ${commitHash} ${tagName}"; done < <(git for-each-ref --sort=v:refname --format='%(*creatordate:raw)%00%(creatordate:raw)%00%(refname)' refs/tags | awk -F"\0" 'BEGIN {ORS=""} $1 == "" {print $2} $1 != "" {print $1} {print "\t"$3"\n"}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Output goes like:
 | 
					# Output goes like:
 | 
				
			||||||
...
 | 
					...
 | 
				
			||||||
89511f06ad4de6b373f10b06604dc5d8e1da02df 6.2.7
 | 
					2023-02-05-091648 89511f06ad4de6b373f10b06604dc5d8e1da02df 6.2.7
 | 
				
			||||||
2025ec8ad74f59981ad6598e9f6cd2a5c9c99f6b 6.2.8
 | 
					2023-03-08-171402 2025ec8ad74f59981ad6598e9f6cd2a5c9c99f6b 6.2.8
 | 
				
			||||||
59a91bfbb6e46885f201e50f9197a7a44d3ba3ac 6.2.9
 | 
					2023-03-27-164321 59a91bfbb6e46885f201e50f9197a7a44d3ba3ac 6.2.9
 | 
				
			||||||
9f2e726e554b23595489eb66c8e11e5d114b573f 6.4.0
 | 
					2023-03-07-191829 9f2e726e554b23595489eb66c8e11e5d114b573f 6.4.0
 | 
				
			||||||
9f16f6d773a2a46f1595c86077899d1e040db283 6.4.1
 | 
					2023-04-03-105513 9f16f6d773a2a46f1595c86077899d1e040db283 6.4.1
 | 
				
			||||||
0fa87156974e799e04bf99e5300bad6830d754ab 6.4.2
 | 
					2023-04-25-133446 0fa87156974e799e04bf99e5300bad6830d754ab 6.4.2
 | 
				
			||||||
...
 | 
					...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' checkout 'tags/x.y.z'
 | 
					git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' checkout 'tags/x.y.z'
 | 
				
			||||||
@@ -122,18 +131,17 @@ You may have to try and find out how a known good base commit differs from a new
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Get commit hashes from both affected tags, e.g.
 | 
					Get commit hashes from both affected tags, e.g.
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
while IFS= read -r tag; do printf -- '%s %s\n' "$(git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' rev-list -n 1 'refs/tags/'"${tag}")" "${tag}"; done < <(git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' --no-pager tag --list --sort=v:refname)
 | 
					pushd '/opt/git/github.com/zabbix/zabbix-docker/branches/latest'
 | 
				
			||||||
 | 
					while IFS= read -r; do commitDate=$(grep -Pio '^.+?(?=[[:space:]])' <<< "${REPLY}"); commitDate=$(date --date='@'"${commitDate}" +%F-%H%M%S); tagRef="$(cut -d $'\t' -f2 <<< "${REPLY}")"; tagName="$(grep -Pio '(?<=refs/tags/)[^\r\n\f]+' <<<"${tagRef}")"; commitHash="$(git rev-list -n 1 "${tagRef}")"; echo "${commitDate} ${commitHash} ${tagName}"; done < <(git for-each-ref --sort=v:refname --format='%(*creatordate:raw)%00%(creatordate:raw)%00%(refname)' refs/tags | awk -F"\0" 'BEGIN {ORS=""} $1 == "" {print $2} $1 != "" {print $1} {print "\t"$3"\n"}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Output goes like:
 | 
					# Output goes like:
 | 
				
			||||||
...
 | 
					...
 | 
				
			||||||
89511f06ad4de6b373f10b06604dc5d8e1da02df 6.2.7
 | 
					2023-02-05-091648 89511f06ad4de6b373f10b06604dc5d8e1da02df 6.2.7
 | 
				
			||||||
2025ec8ad74f59981ad6598e9f6cd2a5c9c99f6b 6.2.8
 | 
					2023-03-08-171402 2025ec8ad74f59981ad6598e9f6cd2a5c9c99f6b 6.2.8
 | 
				
			||||||
59a91bfbb6e46885f201e50f9197a7a44d3ba3ac 6.2.9
 | 
					2023-03-27-164321 59a91bfbb6e46885f201e50f9197a7a44d3ba3ac 6.2.9
 | 
				
			||||||
9f2e726e554b23595489eb66c8e11e5d114b573f 6.4.0
 | 
					2023-03-07-191829 9f2e726e554b23595489eb66c8e11e5d114b573f 6.4.0
 | 
				
			||||||
9f16f6d773a2a46f1595c86077899d1e040db283 6.4.1
 | 
					2023-04-03-105513 9f16f6d773a2a46f1595c86077899d1e040db283 6.4.1
 | 
				
			||||||
0fa87156974e799e04bf
 | 
					2023-04-25-133446 0fa87156974e799e04bf99e5300bad6830d754ab 6.4.2
 | 
				
			||||||
# Run
 | 
					 | 
				
			||||||
99e5300bad6830d754ab 6.4.2
 | 
					 | 
				
			||||||
...
 | 
					...
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -152,16 +160,17 @@ Commit your updated patch file into _this_ repo. With a new working patch in han
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Get desired tag e.g. from version-sorted tags list
 | 
					Get desired tag e.g. from version-sorted tags list
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
while IFS= read -r tag; do printf -- '%s %s\n' "$(git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' rev-list -n 1 'refs/tags/'"${tag}")" "${tag}"; done < <(git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' --no-pager tag --list --sort=v:refname)
 | 
					pushd '/opt/git/github.com/zabbix/zabbix-docker/branches/latest'
 | 
				
			||||||
 | 
					while IFS= read -r; do commitDate=$(grep -Pio '^.+?(?=[[:space:]])' <<< "${REPLY}"); commitDate=$(date --date='@'"${commitDate}" +%F-%H%M%S); tagRef="$(cut -d $'\t' -f2 <<< "${REPLY}")"; tagName="$(grep -Pio '(?<=refs/tags/)[^\r\n\f]+' <<<"${tagRef}")"; commitHash="$(git rev-list -n 1 "${tagRef}")"; echo "${commitDate} ${commitHash} ${tagName}"; done < <(git for-each-ref --sort=v:refname --format='%(*creatordate:raw)%00%(creatordate:raw)%00%(refname)' refs/tags | awk -F"\0" 'BEGIN {ORS=""} $1 == "" {print $2} $1 != "" {print $1} {print "\t"$3"\n"}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Output goes like:
 | 
					# Output goes like:
 | 
				
			||||||
...
 | 
					...
 | 
				
			||||||
89511f06ad4de6b373f10b06604dc5d8e1da02df 6.2.7
 | 
					2023-02-05-091648 89511f06ad4de6b373f10b06604dc5d8e1da02df 6.2.7
 | 
				
			||||||
2025ec8ad74f59981ad6598e9f6cd2a5c9c99f6b 6.2.8
 | 
					2023-03-08-171402 2025ec8ad74f59981ad6598e9f6cd2a5c9c99f6b 6.2.8
 | 
				
			||||||
59a91bfbb6e46885f201e50f9197a7a44d3ba3ac 6.2.9
 | 
					2023-03-27-164321 59a91bfbb6e46885f201e50f9197a7a44d3ba3ac 6.2.9
 | 
				
			||||||
9f2e726e554b23595489eb66c8e11e5d114b573f 6.4.0
 | 
					2023-03-07-191829 9f2e726e554b23595489eb66c8e11e5d114b573f 6.4.0
 | 
				
			||||||
9f16f6d773a2a46f1595c86077899d1e040db283 6.4.1
 | 
					2023-04-03-105513 9f16f6d773a2a46f1595c86077899d1e040db283 6.4.1
 | 
				
			||||||
0fa87156974e799e04bf99e5300bad6830d754ab 6.4.2
 | 
					2023-04-25-133446 0fa87156974e799e04bf99e5300bad6830d754ab 6.4.2
 | 
				
			||||||
...
 | 
					...
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -172,10 +181,10 @@ git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' checkout 'tags
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Apply patch
 | 
					## Apply patch
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Identify yourself to the local `zabbix-docker` repo
 | 
					Identify yourself to the local `zabbix-docker` repo. Obviously substitute your own name. An e-mail address is optional here. You don't want to contribute upstream, you just want to locally apply a patch file.
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' config user.name "hygienic-books"
 | 
					git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' config user.name "hygienic-books"
 | 
				
			||||||
git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' config user.email "hygienic-books@tentic.net"
 | 
					git -C '/opt/git/github.com/zabbix/zabbix-docker/branches/latest' config user.email ""
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Apply `zabbix-docker.patch` to Docker Compose file. We use Zabbix' `docker-compose_v3_alpine_pgsql_latest.yaml` Compose file. Assuming this repo lives at `/opt/containers/zabbixserver`:
 | 
					Apply `zabbix-docker.patch` to Docker Compose file. We use Zabbix' `docker-compose_v3_alpine_pgsql_latest.yaml` Compose file. Assuming this repo lives at `/opt/containers/zabbixserver`:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user