Skip to content

Commit 8a99f6f

Browse files
committed
Escaping quotes in labels, updating go build for caddy
1 parent 7d56a2c commit 8a99f6f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GOLANG_VERSION=1.17
1+
ARG GOLANG_VERSION=1.19
22
ARG ALPINE_VERSION=3.15
33

44
#Use a builder to build caddy with the DNS plugin
@@ -11,11 +11,9 @@ WORKDIR /go/src/github.com/caddyserver/xcaddy/cmd/xcaddy
1111
RUN apk add --no-cache git gcc build-base; \
1212
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest;
1313

14-
#this last with can probably be removed, it's temp due to an ambigous import!
1514
RUN xcaddy build \
1615
--output /go/src/github.com/caddyserver/xcaddy/cmd/caddy \
17-
--with github.com/caddy-dns/cloudflare \
18-
--with github.com/antlr/antlr4=github.com/antlr/antlr4/runtime/Go/[email protected]
16+
--with github.com/caddy-dns/cloudflare
1917

2018
#Final Image
2119
FROM alpine:${ALPINE_VERSION}

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ checkContainer() {
5050
inspect=`docker inspect $id`
5151

5252
#get the hostname and config from our labels from the container!
53-
read hostname name network ports labels< <(echo $(echo ${inspect} | jq --raw-output '.[0] | .Name as $name | .NetworkSettings as $network | .Config.ExposedPorts as $ports | .Config.Labels | . as $labels | to_entries[] | select(.key == "subway.hostname") | "\(.value) \($name) \($network) \($ports) \($labels)"'))
53+
read hostname name network ports labels< <(echo $(echo ${inspect} | jq --raw-output '.[0] | .Name as $name | .NetworkSettings as $network | .Config.ExposedPorts as $ports | .Config.Labels | . as $labels | to_entries[] | select(.key == "subway.hostname") | "\(.value) \($name) \($network) \($ports) \($labels)"') | sed -r 's/\\"/\\\\"/g')
5454
if [[ $hostname ]]
5555
then
5656
echo "$(date -u +'%Y-%m-%dT%H:%M:%SZ') SUBWAY Container ${name:1} found with status ${action} and subway.hostname ${hostname}..."

0 commit comments

Comments
 (0)