Last active
December 9, 2023 18:10
-
-
Save bouroo/e76efb62be16fc26c8ec92c9ebf62d1b to your computer and use it in GitHub Desktop.
docker-nginx-http3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#============================================================================== | |
# title: docker-nginx-http3.sh | |
# description: build nginx http3 support from https://github.com/patrikjuvonen/docker-nginx-http3 | |
# author: Kawin Viriyaprasopsook <kawin.v@kkumail.com> | |
# usage: bash docker-nginx-http3.sh | |
# notes: need `docker curl git` packages | |
#============================================================================== | |
git clone https://github.com/patrikjuvonen/docker-nginx-http3.git tmp | |
cd tmp | |
stable_version=$(curl -s https://nginx.org/packages/debian/pool/nginx/n/nginx/ | grep -oP '\d+\.\d+\.\d+' | sort -V | tail -1) | |
mainline_version=$(curl -s https://nginx.org/packages/mainline/debian/pool/nginx/n/nginx/ | grep -oP '\d+\.\d+\.\d+' | sort -V | tail -1) | |
docker build \ | |
--build-arg="NGINX_VERSION=${stable_version}" \ | |
--build-arg="BUILD_DATE=$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")" \ | |
--build-arg="VCS_REF=$(git rev-parse --short HEAD)" \ | |
--build-arg="GITHUB_REF=$(git rev-parse --abbrev-ref HEAD)" \ | |
--build-arg="GITHUB_RUN_ID=0" \ | |
--build-arg="GITHUB_RUN_NUMBER=0" \ | |
--build-arg="GITHUB_RUN_ATTEMPT=0" \ | |
-t docker-nginx-http3:stable . | |
docker build \ | |
--build-arg="NGINX_VERSION=${mainline_version}" \ | |
--build-arg="BUILD_DATE=$(date +%F)$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")" \ | |
--build-arg="VCS_REF=$(git rev-parse --short HEAD)" \ | |
--build-arg="GITHUB_REF=$(git rev-parse --abbrev-ref HEAD)" \ | |
--build-arg="GITHUB_RUN_ID=0" \ | |
--build-arg="GITHUB_RUN_NUMBER=0" \ | |
--build-arg="GITHUB_RUN_ATTEMPT=0" \ | |
-t docker-nginx-http3:mainline -t docker-nginx-http3 . | |
cd .. | |
rm -rf tmp | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment