0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

build: fix build artifacts in binary

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
Ramkumar Chinchani 2021-12-07 20:51:04 +00:00 committed by Ramkumar Chinchani
parent 63a75216ed
commit d4307d96ac
3 changed files with 8 additions and 7 deletions

View file

@ -11,19 +11,19 @@ OS ?= linux
ARCH ?= amd64
.PHONY: all
all: swagger binary binary-minimal exporter-minimal debug test test-clean check
all: swagger binary binary-minimal binary-debug exporter-minimal test test-clean check
.PHONY: binary-minimal
binary-minimal: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-minimal -tags minimal,containers_image_openpgp -v -trimpath -ldflags "-X github.com/project-zot/zot/pkg/api/config.Commit=${COMMIT} -X github.com/project-zot/zot/pkg/api/config.BinaryType=minimal -X github.com/project-zot/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-minimal -tags minimal,containers_image_openpgp -v -trimpath -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=minimal -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
.PHONY: binary
binary: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot -tags extended,containers_image_openpgp -v -trimpath -ldflags "-X github.com/project-zot/zot/pkg/api/config.Commit=${COMMIT} -X github.com/project-zot/zot/pkg/api/config.BinaryType=extended -X github.com/project-zot/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot -tags extended,containers_image_openpgp -v -trimpath -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=extended -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
.PHONY: debug
debug: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-debug -tags extended,containers_image_openpgp -v -gcflags all='-N -l' -ldflags "-X github.com/project-zot/zot/pkg/api/config.Commit=${COMMIT} -X github.com/project-zot/zot/pkg/api/config.BinaryType=extended -X github.com/project-zot/zot/pkg/api/config.GoVersion=${GO_VERSION}" ./cmd/zot
.PHONY: binary-debug
binary-debug: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-debug -tags extended,containers_image_openpgp -v -gcflags all='-N -l' -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=extended -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION}" ./cmd/zot
.PHONY: exporter-minimal
exporter-minimal: swagger

View file

@ -21,6 +21,7 @@ https://zotregistry.io
* Supports container image signatures - [cosign](https://github.com/sigstore/cosign) and [notation](https://github.com/notaryproject/notation)
* Supports [helm charts](https://helm.sh/docs/topics/registries/)
* Behavior controlled via [configuration](./examples/README.md)
* Supports `amd64` (Intel, AMD, etc) and `arm64` (ARM servers, Raspberry PI 4, etc) architectures
* Supports image deletion by tag
* Currently suitable for on-prem deployments (e.g. colocated with Kubernetes)
* Compatible with ecosystem tools such as [skopeo](#skopeo) and [cri-o](#cri-o)

View file

@ -129,7 +129,7 @@ func NewRootCmd() *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
if showVersion {
log.Info().Str("distribution-spec", distspec.Version).Str("commit", config.Commit).
Str("binary-type", config.BinaryType).Msg("version")
Str("binary-type", config.BinaryType).Str("go version", config.GoVersion).Msg("version")
}
_ = cmd.Usage()
cmd.SilenceErrors = false