diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6c2da4..9f4c3bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/.goreleaser.yml b/.goreleaser.yml index a7e90ab..c8611c3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,8 +2,7 @@ before: hooks: - go mod download builds: - - - env: + - env: - CGO_ENABLED=0 goos: - linux @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c397aa0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +COPY odohd /usr/bin/odohd +ENTRYPOINT ["/usr/bin/odohd"]