forked from grafana/pyroscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.windows
41 lines (32 loc) · 1.2 KB
/
Dockerfile.windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM golang:1.19-alpine3.16 AS go-builder
RUN apk add --no-cache make git zstd gcc g++ libc-dev musl-dev bash mingw-w64-gcc
WORKDIR /opt/pyroscope/
COPY pkg ./pkg
COPY cmd ./cmd
COPY webapp/assets.go ./webapp/assets.go
COPY scripts ./scripts
COPY go.mod go.sum ./
# Generate .syso object file.
RUN source scripts/packages/git-info && go run scripts/windows/generate-windows-version-info/main.go \
-version "$GIT_TAG" \
-icon scripts/windows/resources/app.ico \
-out cmd/pyroscope/resource.syso
## Build for Windows x64 only.
RUN GOOS=windows GOARCH=amd64 go build \
-trimpath -ldflags "$(scripts/generate-build-flags.sh)" \
-tags dotnetspy \
-o pyroscope.exe \
./cmd/pyroscope
FROM harbottle/wix AS msi-builder
COPY --from=go-builder /opt/pyroscope/pyroscope.exe pyroscope.exe
COPY scripts/windows/pyroscope.wsx pyroscope.wsx
COPY scripts/windows/resources resources
# Build MSI package.
RUN candle -arch x64 -ext WixUtilExtension \
-dPyroscopeSourceExecutable=pyroscope.exe \
pyroscope.wsx && \
light -sval -ext WixUtilExtension \
pyroscope.wixobj
FROM scratch AS msi-exporter
COPY --from=msi-builder /mnt/workspace/pyroscope.exe /
COPY --from=msi-builder /mnt/workspace/pyroscope.msi /