|
1 | | -FROM stefanscherer/chocolatey AS tar |
2 | | -RUN choco install -y 7zip |
| 1 | +# escape=` |
| 2 | +FROM microsoft/windowsservercore AS tar |
| 3 | +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] |
| 4 | +RUN Invoke-WebRequest 'http://www.7-zip.org/a/7z1604-x64.msi' -OutFile '7z.msi' -UseBasicParsing |
| 5 | +RUN Start-Process msiexec.exe -ArgumentList '/i', '7z.msi', '/quiet', '/norestart' -NoNewWindow -Wait |
| 6 | + |
3 | 7 | ENV PROMETHEUS_VERSION 1.6.1 |
4 | | -RUN Invoke-WebRequest $('https://github.com/prometheus/prometheus/releases/download/v{0}/prometheus-{0}.windows-amd64.tar.gz' -f $env:PROMETHEUS_VERSION) -OutFile 'prometheus.tar.gz' -UseBasicParsing ; \ |
5 | | - & 'C:\Program Files\7-Zip\7z.exe' x prometheus.tar.gz ; \ |
6 | | - & 'C:\Program Files\7-Zip\7z.exe' x prometheus.tar ; \ |
7 | | - Rename-Item -Path $('C:\prometheus-{0}.windows-amd64' -f $env:PROMETHEUS_VERSION) -NewName 'C:\download' |
| 8 | + |
| 9 | +RUN Invoke-WebRequest $('https://github.com/prometheus/prometheus/releases/download/v{0}/prometheus-{0}.windows-amd64.tar.gz' -f $env:PROMETHEUS_VERSION) -OutFile 'prometheus.tar.gz' -UseBasicParsing |
| 10 | +RUN & 'C:\Program Files\7-Zip\7z.exe' x prometheus.tar.gz |
| 11 | +RUN & 'C:\Program Files\7-Zip\7z.exe' x prometheus.tar |
| 12 | +RUN Rename-Item -Path $('C:\prometheus-{0}.windows-amd64' -f $env:PROMETHEUS_VERSION) -NewName 'C:\download' |
8 | 13 |
|
9 | 14 | FROM microsoft/nanoserver |
10 | 15 |
|
11 | | -COPY --from tar /download/prometheus.exe /bin/prometheus.exe |
12 | | -COPY --from tar /download/promtool.exe /bin/promtool.exe |
13 | | -COPY --from tar /download/prometheus.yml /etc/prometheus/prometheus.yml |
14 | | -COPY --from tar /download/console_libraries/ /etc/prometheus/ |
15 | | -COPY --from tar /download/consoles/ /etc/prometheus/ |
| 16 | +COPY --from=tar /download/prometheus.exe /bin/prometheus.exe |
| 17 | +COPY --from=tar /download/promtool.exe /bin/promtool.exe |
| 18 | +COPY --from=tar /download/prometheus.yml /etc/prometheus/prometheus.yml |
| 19 | +COPY --from=tar /download/console_libraries/ /etc/prometheus/ |
| 20 | +COPY --from=tar /download/consoles/ /etc/prometheus/ |
16 | 21 |
|
17 | 22 | EXPOSE 9090 |
18 | | -VOLUME [ "/prometheus" ] |
19 | | -WORKDIR /prometheus |
| 23 | +VOLUME C:\prometheus |
| 24 | +WORKDIR C:\prometheus |
20 | 25 | ENTRYPOINT [ "C:\\bin\\prometheus.exe" ] |
21 | | -CMD [ "-config.file=/etc/prometheus/prometheus.yml", \ |
22 | | - "-storage.local.path=/prometheus", \ |
23 | | - "-web.console.libraries=/etc/prometheus/console_libraries", \ |
| 26 | +CMD [ "-config.file=/etc/prometheus/prometheus.yml", ` |
| 27 | + "-storage.local.path=/prometheus", ` |
| 28 | + "-web.console.libraries=/etc/prometheus/console_libraries", ` |
24 | 29 | "-web.console.templates=/etc/prometheus/consoles" ] |
0 commit comments