From e82eeef365cf974478e5af92e2f64e5857e6aee4 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 15 Oct 2022 17:04:12 -0400 Subject: [PATCH 1/2] add customized Grafana for listening on port 80 --- grafana/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 grafana/Dockerfile diff --git a/grafana/Dockerfile b/grafana/Dockerfile new file mode 100644 index 0000000..ca2c04e --- /dev/null +++ b/grafana/Dockerfile @@ -0,0 +1,10 @@ +FROM grafana/grafana:9.2.0 + +USER root + +# Add cap_net_bind_service to grafana-server, and set default port to 80 +RUN apk add --no-cache libcap-utils --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \ + && setcap cap_net_bind_service=+ep ${GF_PATHS_HOME}/bin/grafana-server \ + && sed -i "s/;http_port = 3000/http_port = 80/" ${GF_PATHS_CONFIG} + +USER grafana From 8bb78bfd3a09bd55708235a359e2fe4bebcd07ec Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 15 Oct 2022 17:04:35 -0400 Subject: [PATCH 2/2] build: Fail fast --- build-image.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-image.sh b/build-image.sh index 4b568a9..26b081e 100755 --- a/build-image.sh +++ b/build-image.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + [ -z "$1" ] && exit 1 docker build $1 -t gitea.angry.im/petercxy/$1:latest