Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add support for releasing tfctl as a docker container #1470

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ example/
# Local dev files
Tiltfile.local
/config/tilt/helm/dev-values-local.yaml

dist/
51 changes: 47 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2
project_name: tf-controller

release:
Expand Down Expand Up @@ -28,8 +31,8 @@ builds:
- arm64
- arm
goarm:
- 6
- 7
- "6"
- "7"

archives:
- id: tfctl
Expand Down Expand Up @@ -69,14 +72,54 @@ brews:
- name: tfctl
ids:
- tfctl
tap:
repository:
owner: flux-iac
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_author:
name: flux-iac
email: [email protected]
folder: Formula
directory: Formula
homepage: https://flux-iac.github.io/tofu-controller
install: |
bin.install "tfctl"

dockers:
- image_templates:
- "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}-amd64"
use: buildx
dockerfile: tfctl.Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.url=https://github.com/flux-iac/{{.ProjectName}}"
- "--label=org.opencontainers.image.source=https://github.com/flux-iac/{{.ProjectName}}"
- "--label=org.opencontainers.image.licenses=Apache-2.0"
- image_templates:
- "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}-arm64v8"
use: buildx
goarch: arm64
dockerfile: tfctl.Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.url=https://github.com/flux-iac/{{.ProjectName}}"
- "--label=org.opencontainers.image.source=https://github.com/flux-iac/{{.ProjectName}}"
- "--label=org.opencontainers.image.licenses=Apache-2.0"

docker_manifests:
- name_template: "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}"
image_templates:
- "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}-amd64"
- "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}-arm64v8"

- name_template: "ghcr.io/flux-iac/{{.ProjectName}}:latest"
image_templates:
- "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}-amd64"
- "ghcr.io/flux-iac/{{.ProjectName}}:v{{.Version}}-arm64v8"
4 changes: 4 additions & 0 deletions tfctl.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
USER 65532:65532
COPY tfctl /usr/local/bin/tfctl
ENTRYPOINT ["/usr/local/bin/tfctl"]