From b6f0cb7b02d031f509e08a2b7b517a55245238f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Duarte?= Date: Thu, 8 Feb 2024 11:49:06 +0000 Subject: [PATCH] introduce go.mod for env2yaml --- docker/Makefile | 12 ++++-------- docker/data/golang/Dockerfile | 4 ---- docker/data/logstash/env2yaml/go.mod | 5 +++++ docker/data/logstash/env2yaml/go.sum | 3 +++ 4 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 docker/data/golang/Dockerfile create mode 100644 docker/data/logstash/env2yaml/go.mod create mode 100644 docker/data/logstash/env2yaml/go.sum diff --git a/docker/Makefile b/docker/Makefile index 82b265808fd..3648c402ffa 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -200,16 +200,12 @@ venv: requirements.txt for i in 0 1 2 3 4 5; do sleep "$i"; pip install -r requirements.txt && break; done &&\ touch venv -# Make a Golang container that can compile our env2yaml tool. -golang: - docker build -t golang:env2yaml data/golang - # Compile "env2yaml", the helper for configuring logstash.yml via environment # variables. -env2yaml: golang - docker run --rm -i \ - -v $(PWD)/data/logstash/env2yaml:/usr/local/src/env2yaml:Z \ - golang:env2yaml +env2yaml: + docker run --rm \ + -v "$(PWD)/data/logstash/env2yaml:/usr/src/env2yaml" \ + -w /usr/src/env2yaml golang:1 go build # Generate the Dockerfiles from Jinja2 templates. dockerfile: venv templates/Dockerfile.j2 diff --git a/docker/data/golang/Dockerfile b/docker/data/golang/Dockerfile deleted file mode 100644 index ae12b80fdd5..00000000000 --- a/docker/data/golang/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM golang:1 -RUN go env -w GO111MODULE=off && (for i in 0 1 2 3 4 5; do sleep "$i"; go get gopkg.in/yaml.v2 && break; done) -WORKDIR /usr/local/src/env2yaml -CMD ["go", "build"] diff --git a/docker/data/logstash/env2yaml/go.mod b/docker/data/logstash/env2yaml/go.mod new file mode 100644 index 00000000000..7600007420d --- /dev/null +++ b/docker/data/logstash/env2yaml/go.mod @@ -0,0 +1,5 @@ +module logstash/env2yaml + +go 1.21 + +require gopkg.in/yaml.v2 v2.4.0 diff --git a/docker/data/logstash/env2yaml/go.sum b/docker/data/logstash/env2yaml/go.sum new file mode 100644 index 00000000000..75346616b19 --- /dev/null +++ b/docker/data/logstash/env2yaml/go.sum @@ -0,0 +1,3 @@ +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=