-
-
Notifications
You must be signed in to change notification settings - Fork 687
chore: Distribute as docker image #1875
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
base: main
Are you sure you want to change the base?
Changes from all commits
a938d5b
ef67e13
751643b
933a0d3
0b36547
ee2a48a
68ffcd5
499d774
ed262a6
d4eb798
61e8748
6809a1d
070567f
e09b7dc
bd155e2
fff0b84
d903835
528970e
a447222
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,13 @@ jobs: | |
with: | ||
go-version: 1.24.x | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,3 +131,54 @@ winget: | |
owner: go-task | ||
name: winget-pkgs | ||
branch: "bump-task-to-{{.Tag}}" | ||
|
||
dockers: | ||
- image_templates: | ||
- "ghcr.io/go-task/task:v{{.Version}}-amd64" | ||
use: buildx | ||
dockerfile: 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://taskfile.dev" | ||
- "--label=org.opencontainers.image.source=https://github.com/go-task/task" | ||
- "--label=org.opencontainers.image.licenses=MIT" | ||
- "--label=org.opencontainers.image.authors=The Task authors <[email protected]>" | ||
- "--label=org.opencontainers.image.description=Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make." | ||
- image_templates: | ||
- "ghcr.io/go-task/task:v{{.Version}}-arm64" | ||
use: buildx | ||
goarch: arm64 | ||
dockerfile: 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://taskfile.dev" | ||
- "--label=org.opencontainers.image.source=https://github.com/go-task/task" | ||
- "--label=org.opencontainers.image.licenses=MIT" | ||
- "--label=org.opencontainers.image.authors=The Task authors <[email protected]>" | ||
- "--label=org.opencontainers.image.description=Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make." | ||
|
||
docker_manifests: | ||
- name_template: "ghcr.io/go-task/task:v{{.Major}}.{{.Minor}}.{{.Patch}}" | ||
image_templates: | ||
- "ghcr.io/go-task/task:v{{.Version}}-amd64" | ||
- "ghcr.io/go-task/task:v{{.Version}}-arm64" | ||
- name_template: "ghcr.io/go-task/task:v{{.Major}}.{{.Minor}}" | ||
image_templates: | ||
- "ghcr.io/go-task/task:v{{.Version}}-amd64" | ||
- "ghcr.io/go-task/task:v{{.Version}}-arm64" | ||
- name_template: "ghcr.io/go-task/task:v{{.Major}}" | ||
image_templates: | ||
- "ghcr.io/go-task/task:v{{.Version}}-amd64" | ||
- "ghcr.io/go-task/task:v{{.Version}}-arm64" | ||
- name_template: "ghcr.io/go-task/task:latest" | ||
image_templates: | ||
- "ghcr.io/go-task/task:v{{.Version}}-amd64" | ||
- "ghcr.io/go-task/task:v{{.Version}}-arm64" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,3 @@ | ||||||
FROM gcr.io/distroless/static-debian12:nonroot | ||||||
COPY task /task | ||||||
CMD ["/task"] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably better if you would actually run this container for whatever reasons 😅
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since its based on distroless, would you ever run it by itself though? I think this would maybe make sense with a usable base. Dunno There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could use the CLI / help at least if you're curious 😉 |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -201,6 +201,23 @@ If you want to install Task in GitHub Actions you can try using | |||||
|
||||||
This installation method is community owned. | ||||||
|
||||||
### Docker | ||||||
|
||||||
If you are building a Docker image that, among other utilities, must contain `task` as well, you can copy over both the binary as well as the appropriate Bash completion for your shell from the official `ghcr.io/go-task/task` Docker image: | ||||||
|
||||||
:::info | ||||||
|
||||||
The image is available only for `amd64` and `arm64v8` architectures and only for Task versions starting at v3.40.2. | ||||||
|
||||||
::: | ||||||
|
||||||
```Dockerfile | ||||||
FROM ubuntu:22.04 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Back to the future... 🚀
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point we might as well put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course, it's just an example anyway. Convention is not to use latest, the user should override anyway. |
||||||
# ... | ||||||
COPY --from=ghcr.io/go-task/task:v3.40.2 /usr/local/bin/task /usr/local/bin/task | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use the nice new "shortcut"
Suggested change
|
||||||
# ... | ||||||
``` | ||||||
|
||||||
## Build From Source | ||||||
|
||||||
### Go Modules | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the build is "hardened", let's just make sure that users can read and execute automatically
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this isn't really necessary. We started under the assumption this is a means to distribute the binary. You can just copy it from this container and apply whatever permissions you want on it in your container
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion. Most users don't know or care about permissions, this argument would make it easier for everyone, it's a binary after all.