github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/Dockerfile.windows (about)

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