diff --git a/.goreleaser.yml b/.goreleaser.yml index ebcd920b80..afb0aa7c0a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 " + - "--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}}-arm64v8" + 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 " + - "--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}}-arm64v8" + - 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}}-arm64v8" + - 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}}-arm64v8" + - 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}}-arm64v8" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..fb6418e684 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch +COPY task /usr/local/bin/task +CMD ["/usr/local/bin/task"] diff --git a/website/docs/installation.mdx b/website/docs/installation.mdx index 1e93bc8083..88ebc8edf8 100644 --- a/website/docs/installation.mdx +++ b/website/docs/installation.mdx @@ -220,6 +220,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 +# ... +COPY --from=ghcr.io/go-task/task:v3.40.2 /usr/local/bin/task /usr/local/bin/task +# ... +``` + ## Build From Source ### Go Modules