Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # Copyright 2017 The Kubernetes Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. FROM golang:1.12.0 AS builder
  15. COPY elasticsearch_logging_discovery.go go.mod go.sum /
  16. RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -ldflags "-w" -o /elasticsearch_logging_discovery /elasticsearch_logging_discovery.go
  17. FROM docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2
  18. VOLUME ["/data"]
  19. EXPOSE 9200 9300
  20. COPY --from=builder /elasticsearch_logging_discovery bin/
  21. COPY run.sh bin/
  22. COPY config/elasticsearch.yml config/log4j2.properties config/
  23. USER root
  24. RUN chown -R elasticsearch:elasticsearch ./
  25. CMD ["bin/run.sh"]