Skip to content

Commit

Permalink
Build container image
Browse files Browse the repository at this point in the history
  • Loading branch information
George Gkioulis committed Oct 16, 2020
1 parent fb834e9 commit 62e46c7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,38 @@ builds:
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser

dockers:
# You can have multiple Docker images.
-
# GOOS of the built binary that should be used.
goos: linux

# GOARCH of the built binary that should be used.
goarch: amd64

# Name templates of the built binaries that should be used.
binaries:
- romie

# Templates of the Docker image names.
image_templates:
- "myuser/romie:latest"
- "myuser/romie:{{ .Tag }}"

# Skips the docker push. Could be useful if you also do draft releases.
# If set to auto, the release will not be pushed to the docker repository
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Defaults to false.
skip_push: true

# Path to the Dockerfile (from the project root).
dockerfile: Dockerfile

# Template of the docker build flags.
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
COPY romie /
ENTRYPOINT ["/romie"]

0 comments on commit 62e46c7

Please sign in to comment.