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 a05b510fc3
commit e5b1b15dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save