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=