mirror of
https://github.com/Direct-Dev-Ru/go-lcg.git
synced 2025-11-16 01:29:55 +00:00
release v1.0.1
This commit is contained in:
25
Dockerfiles/ImageBuild/Dockerfile
Normal file
25
Dockerfiles/ImageBuild/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM --platform=${BUILDPLATFORM} golang:1.23-alpine AS builder
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
RUN apk add git && go install mvdan.cc/garble@latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN echo $BUILDPLATFORM > buildplatform
|
||||
RUN echo $TARGETARCH > targetarch
|
||||
|
||||
# RUN GOOS=linux GOARCH=$TARGETARCH go build -o output/go-ansible-vault
|
||||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} garble -literals -tiny build -ldflags="-w -s" -o /app/go-lcg .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
# COPY --from=builder /app/buildplatform .
|
||||
# COPY --from=builder /app/targetarch .
|
||||
COPY --from=builder /app/go-lcg /root/lcg
|
||||
|
||||
ENTRYPOINT ["/root/lcg"]
|
||||
23
Dockerfiles/LocalCompile/Dockerfile
Normal file
23
Dockerfiles/LocalCompile/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM --platform=${BUILDPLATFORM} golang:1.23-alpine AS build
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
RUN apk add git && go install mvdan.cc/garble@latest
|
||||
WORKDIR /src
|
||||
ENV CGO_ENABLED=0
|
||||
COPY go.* .
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
|
||||
# RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /out/go-ansible-vault .
|
||||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} garble -literals -tiny build -ldflags="-w -s" -o /out/go-lcg .
|
||||
|
||||
FROM scratch AS bin-unix
|
||||
COPY --from=build /out/go-lcg /lcg
|
||||
|
||||
FROM bin-unix AS bin-linux
|
||||
FROM bin-unix AS bin-darwin
|
||||
|
||||
FROM scratch AS bin-windows
|
||||
COPY --from=build /out/go-lcg /lcg.exe
|
||||
|
||||
FROM bin-${TARGETOS} AS bin
|
||||
Reference in New Issue
Block a user