Skip to content

Commit c47bc0a

Browse files
committed
Add prometheus
1 parent 836b231 commit c47bc0a

4 files changed

Lines changed: 34 additions & 0 deletions

File tree

prometheus/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM stefanscherer/chocolatey AS tar
2+
RUN choco install -y 7zip
3+
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+
FROM microsoft/nanoserver
10+
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+
17+
EXPOSE 9090
18+
VOLUME [ "/prometheus" ]
19+
WORKDIR /prometheus
20+
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", \
24+
"-web.console.templates=/etc/prometheus/consoles" ]

prometheus/build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
. $PSScriptRoot\..\update-docker-rc.ps1
2+
3+
docker build -t prometheus .

prometheus/push.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docker tag prometheus stefanscherer/prometheus-windows:1.6.1
2+
docker tag prometheus stefanscherer/prometheus-windows:latest
3+
docker push stefanscherer/prometheus-windows:1.6.1
4+
docker push stefanscherer/prometheus-windows:latest

prometheus/test.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docker run -d -p 9090:9090 prometheus
2+
Start-Sleep 10
3+
docker logs $(docker ps -ql)

0 commit comments

Comments
 (0)