Skip to content

Commit

Permalink
feat: add docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Nov 7, 2021
1 parent 952e8b0 commit ee6beb2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
23 changes: 21 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ before:
hooks:
- go mod download
builds:
-
env:
- env:
- CGO_ENABLED=0
goos:
- linux
Expand All @@ -24,3 +23,23 @@ nfpms:
formats:
- deb
- rpm
dockers:
- image_templates: ["ghcr.io/emeraldonion/odohd:{{ .Version }}-amd64"]
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title=odohd
- --label=org.opencontainers.image.description=Oblivious DNS over HTTPS Server
- --label=org.opencontainers.image.url=https://github.com/emeraldonion/odohd
- --label=org.opencontainers.image.source=https://github.com/emeraldonion/odohd
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
docker_manifests:
- name_template: ghcr.io/emeraldonion/odohd:{{ .Version }}
image_templates:
- ghcr.io/emeraldonion/odohd:{{ .Version }}-amd64
- name_template: ghcr.io/emeraldonion/odohd:latest
image_templates:
- ghcr.io/emeraldonion/odohd:{{ .Version }}-amd64
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine
COPY odohd /usr/bin/odohd
ENTRYPOINT ["/usr/bin/odohd"]

0 comments on commit ee6beb2

Please sign in to comment.