Skip to content

Commit

Permalink
build: add Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed Apr 7, 2024
1 parent 625e71e commit 49dd413
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
builds:
- skip: true

dockers:
- image_templates:
- "ctferio/{{ .ProjectName }}:latest"
- "ctferio/{{ .ProjectName }}:{{ .Tag }}"
build_flag_templates:
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"

changelog:
sort: asc
filters:
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build stage
FROM golang:1.22.1 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
ENTRYPOINT [ "/ctfd-setup" ]

0 comments on commit 49dd413

Please sign in to comment.