Skip to content

Commit

Permalink
feat: Add labels to docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
obalunenko committed Jan 7, 2025
1 parent 2d578a6 commit bec623c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ help:

## Build docker images.
build:
docker buildx bake
IMAGE_DESCRIPTION="$$(cat README.md)" docker buildx bake
.PHONY: build

## Sync vendor.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ The base image is built on top of the official image [golang:1.23.4-alpine3.21](
| [buf](https://github.com/bufbuild/buf) | v1.48.0 | The buf CLI is the best tool for working with Protocol Buffers |
| [coverbadger](https://github.com/obalunenko/coverbadger) | v1.4.0 | Generate coverage badge images for Markdown files using Go |
| [enumer](https://github.com/alvaroloes/enumer) | v1.1.2 | A Go tool to auto generate methods for your enums |
| [fiximports](https://golang.org/x/tools/cmd/fiximports) | v0.28.0 | The fiximports command fixes import declarations to use the canonical import path for packages that have an "import comment" as defined by https://golang.org/s/go14customimport. |
| [fiximports](https://golang.org/x/tools/cmd/fiximports) | v0.29.0 | The fiximports command fixes import declarations to use the canonical import path for packages that have an "import comment" as defined by https://golang.org/s/go14customimport. |
| [go-enum](https://github.com/abice/go-enum) | v0.6.0 | An enum generator for go |
| [gocov](https://github.com/axw/gocov) | v1.2.1 | Coverage testing tool for The Go Programming Language |
| [gocov-html](https://github.com/matm/gocov-html) | v1.4.0 | Make pretty HTML output from gocov, a coverage testing tool for Go |
| [gofumpt](https://mvdan.cc/gofumpt) | v0.7.0 | A stricter gofmt |
| [goimports](https://golang.org/x/tools/cmd/goimports) | v0.28.0 | Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones |
| [goimports](https://golang.org/x/tools/cmd/goimports) | v0.29.0 | Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones |
| [golangci-lint](https://github.com/golangci/golangci-lint) | v1.62.2 | Fast linters Runner for Go |
| [goose](https://github.com/pressly/goose/v3/cmd/goose) | v3.24.0 | A database migration tool |
| [goreadme](https://github.com/posener/goreadme) | v1.4.2 | Generate readme file from Go doc |
Expand All @@ -40,7 +40,7 @@ The base image is built on top of the official image [golang:1.23.4-alpine3.21](
| [goveralls](https://github.com/mattn/goveralls) | v0.0.12 | Go integration for Coveralls.io continuous code coverage tracking system. |
| [govulncheck](https://golang.org/x/vuln/cmd/govulncheck) | v1.1.3 | Govulncheck reports known vulnerabilities that affect Go code. |
| [pkgsite](https://golang.org/x/pkgsite/cmd/pkgsite) | v0.0.0-20241216215327-06c6edf28e6c | Pkgsite extracts and generates documentation for Go programs. It runs as a web server and presents the documentation as a web page. |
| [stringer](https://golang.org/x/tools/cmd/stringer) | v0.28.0 | Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface. |
| [stringer](https://golang.org/x/tools/cmd/stringer) | v0.29.0 | Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface. |
| [svu](https://github.com/caarlos0/svu) | v2.2.0 | Semantic Version Util |
| [swag](github.com/swaggo/swag/cmd/swag) | v1.16.4 | Automatically generate RESTful API documentation with Swagger 2.0 for Go |
| [swagger](https://github.com/go-swagger/go-swagger) | v0.31.0 | Client/Server from OpenAPI docs generation tool |
Expand Down
14 changes: 13 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@ variable "IMAGE_WITH_REGISTRY" {
default = notequal("",REGISTRY) ? "${REGISTRY}/${IMAGE_NAME}": "${IMAGE_NAME}"
}

variable "IMAGE_TITLE" {
default = "Go Tools"
}

variable "IMAGE_DESCRIPTION" {
default = ""
}

target "docker-metadata-action" {}

target "gotools-latest" {
inherits = ["docker-metadata-action"]
dockerfile = "Dockerfile"
context= "."
context = "."
platforms = ["linux/amd64", "linux/arm64"]
labels = {
"org.opencontainers.image.title" = "${IMAGE_TITLE}"
"org.opencontainers.image.description" = "${IMAGE_DESCRIPTION}"
}
}

0 comments on commit bec623c

Please sign in to comment.