20 строки
541 B
Docker
20 строки
541 B
Docker
FROM golang:windowsservercore-ltsc2022 AS builder
|
|
# Build args
|
|
ARG VERSION
|
|
ARG NPM_AI_PATH
|
|
ARG NPM_AI_ID
|
|
|
|
WORKDIR /usr/src/npm
|
|
RUN mkdir /usr/bin/
|
|
# Copy the source
|
|
COPY . .
|
|
|
|
RUN $Env:CGO_ENABLED=0; go build -v -o /usr/bin/npm.exe -ldflags """-X main.version=${env:VERSION} -X ${env:NPM_AI_PATH}=${env:NPM_AI_ID}""" -gcflags="-dwarflocationlists=true" ./npm/cmd/
|
|
|
|
# Copy into final image
|
|
FROM mcr.microsoft.com/windows/servercore:ltsc2022
|
|
COPY --from=builder /usr/bin/npm.exe \
|
|
/usr/bin/npm.exe
|
|
|
|
ENTRYPOINT ["/usr/bin/npm.exe", "start"]
|