From a05ffe145af8fd007fe6e9245a4ac4a873b06081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20B=C3=A9langer?= Date: Wed, 11 Jan 2023 09:40:36 -0500 Subject: [PATCH] Update go version and container (#4) --- .envrc | 6 ++---- .tool-versions | 2 +- Dockerfile | 4 +++- README.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.envrc b/.envrc index 9c6f461..8b169e1 100644 --- a/.envrc +++ b/.envrc @@ -1,7 +1,5 @@ watch_file .tool-versions -use asdf asdf_has golang || asdf plugin-add golang -asdf install - -layout go \ No newline at end of file +asdf install | sed '/is already installed/d' +use asdf diff --git a/.tool-versions b/.tool-versions index 5f68eb6..a6a7049 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -golang 1.17.2 \ No newline at end of file +golang 1.19.4 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c4d93b4..e57143c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.17-alpine as builder +FROM golang:1.19-alpine as builder RUN apk update && apk add \ git \ @@ -13,6 +13,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-w -s" -o FROM alpine:3 +RUN apk -U --no-cache upgrade + COPY --from=builder /go/bin/docker_state_exporter /go/bin/docker_state_exporter EXPOSE 8080 diff --git a/README.md b/README.md index 827c8c7..10eeb38 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ TODO: Allow for polling interval customization. ```bash git clone https://github.com/AdaptiveConsulting/docker_state_exporter cd docker_state_exporter -docker build . +docker build . -t docker_state_exporter_test ``` ### Run