Browse Source

Dockerfile: Optimize and consolidate steps (#9180)

* Moving up workdir will make mkdir call redundant
* Consolidate into a single RUN instruction
* Prefix etc/prometheus with a slash (it only worked because WORKDIR was
  / )

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
pull/9423/head
Manuel Rüger 3 years ago committed by GitHub
parent
commit
e5b1b15dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      Dockerfile

7
Dockerfile

@ -14,14 +14,13 @@ COPY LICENSE /LICENSE
COPY NOTICE /NOTICE COPY NOTICE /NOTICE
COPY npm_licenses.tar.bz2 /npm_licenses.tar.bz2 COPY npm_licenses.tar.bz2 /npm_licenses.tar.bz2
RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/ WORKDIR /prometheus
RUN mkdir -p /prometheus && \ RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/ && \
chown -R nobody:nobody etc/prometheus /prometheus chown -R nobody:nobody /etc/prometheus /prometheus
USER nobody USER nobody
EXPOSE 9090 EXPOSE 9090
VOLUME [ "/prometheus" ] VOLUME [ "/prometheus" ]
WORKDIR /prometheus
ENTRYPOINT [ "/bin/prometheus" ] ENTRYPOINT [ "/bin/prometheus" ]
CMD [ "--config.file=/etc/prometheus/prometheus.yml", \ CMD [ "--config.file=/etc/prometheus/prometheus.yml", \
"--storage.tsdb.path=/prometheus", \ "--storage.tsdb.path=/prometheus", \

Loading…
Cancel
Save