mirror of
https://github.com/gravitational/teleport
synced 2024-10-22 02:03:24 +00:00
ba75bd9869
* Remove unnecessary cgo and simplify image build * Add a target outputting the buildbox image * Use static distroless image as base image
26 lines
761 B
Makefile
26 lines
761 B
Makefile
# Image URL to use all building/pushing image targets
|
|
IMG ?= teleport-kube-agent-updater:latest
|
|
|
|
# include BUILDBOX_VERSION, BUILDBOX and BUILDBOX_variant variables
|
|
include ../../build.assets/images.mk
|
|
|
|
# Configure which compiler and buildbox to use
|
|
OS ?= $(shell go env GOOS)
|
|
ARCH ?= $(shell go env GOARCH)
|
|
|
|
.PHONY: test
|
|
test: pkg/img/cosign_fixtures_test.go
|
|
go test ./...
|
|
|
|
.PHONY: docker-build
|
|
docker-build: ## Build docker image
|
|
docker buildx build --platform="$(OS)/$(ARCH)" --build-arg BUILDBOX=$(BUILDBOX) \
|
|
-t ${IMG} --load ./ -f ./Dockerfile
|
|
|
|
.PHONY: docker-push
|
|
docker-push: ## Push docker image
|
|
docker push ${IMG}
|
|
|
|
pkg/img/cosign_fixtures_test.go: hack/cosign-fixtures.go
|
|
go run hack/cosign-fixtures.go | gofmt > pkg/img/cosign_fixtures_test.go
|