mirror of
https://codeberg.org/gothub/gothub
synced 2024-12-06 19:16:24 +01:00
add ldflag (please work)
This commit is contained in:
@@ -5,7 +5,7 @@ pipeline:
|
||||
branch: dev
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: DockerfileDev
|
||||
registry: https://codeberg.org/v2
|
||||
repo: codeberg.org/gothub/gothub
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ RUN apk --no-cache add git
|
||||
RUN git clone https://codeberg.org/gothub/gothub .
|
||||
|
||||
RUN go mod download
|
||||
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /src/gothub
|
||||
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /src/gothub
|
||||
|
||||
FROM alpine:3.16 as bin
|
||||
|
||||
@@ -19,4 +19,4 @@ COPY --from=build /src/public ./public
|
||||
ENV DOCKER true
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["/app/gothub", "serve"]
|
||||
CMD ["/app/gothub", "serve"]
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
WORKDIR /src
|
||||
RUN apk --no-cache add git
|
||||
RUN git clone https://codeberg.org/gothub/gothub .
|
||||
|
||||
RUN go mod download
|
||||
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /src/gothub -ldflags="-X codeberg.org/gothub/gothub/utils.Branch=dev"
|
||||
|
||||
FROM alpine:3.16 as bin
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /src/gothub .
|
||||
COPY --from=build /src/views ./views
|
||||
COPY --from=build /src/public ./public
|
||||
|
||||
ENV DOCKER true
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["/app/gothub", "serve"]
|
||||
Reference in New Issue
Block a user