Skip to content

Commit

Permalink
ci: build Dockerfile with goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed Apr 10, 2024
1 parent c369db7 commit fb8c1a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 16 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
before:
hooks:
- go mod tidy

gomod:
proxy: true

builds:
- skip: true
- env:
- CGO_ENABLED=0
main: ./cmd/ctfd-setup
mod_timestamp: "{{ .CommitTimestamp }}"
goos:
- linux
goarch:
- amd64
binary: "{{ .ProjectName }}"

dockers:
- image_templates:
Expand Down
17 changes: 1 addition & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# Build stage
FROM golang:1.22.2@sha256:c4fb952e712efd8f787bcd8e53fd66d1d83b7dc26adabc218e9eac1dbf776bdf AS builder

WORKDIR /go/src
COPY go.mod go.sum ./
RUN go mod download

COPY . .

ENV CGO_ENABLED=0
RUN go build -o /go/bin/ctfd-setup cmd/ctfd-setup/main.go



# Prod stage
FROM scratch
COPY --from=builder /go/bin/ctfd-setup /ctfd-setup
COPY ctfd-setup /
ENTRYPOINT [ "/ctfd-setup" ]

0 comments on commit fb8c1a0

Please sign in to comment.