Browse Source

update workflow scripts

pull/141/head
yedf2 5 years ago
parent
commit
63742982c0
  1. 2
      helper/.goreleaser.yml
  2. 6
      helper/Dockerfile-release

2
helper/.goreleaser.yml

@ -10,6 +10,6 @@ builds:
- amd64
id: 'dtm'
dir: .
main: ./app/main.go
main: main.go
ldflags:
- -s -w -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.Date={{.Date}}

6
helper/Dockerfile-release

@ -6,10 +6,10 @@ WORKDIR /app/dtm
# RUN go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
EXPOSE 8080
COPY . .
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-s -w" app/main.go
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-s -w"
FROM --platform=$TARGETPLATFORM alpine:3.14
COPY --from=builder /app/dtm/main /app/dtm/
COPY --from=builder /app/dtm/dtm /app/dtm/
ENV IS_DOCKER=1
WORKDIR /app/dtm
CMD ["/app/dtm/main", "dtmsvr"]
CMD ["/app/dtm/dtm", "dtmsvr"]

Loading…
Cancel
Save