https://github.com/cilium/cilium
Raw File
Tip revision: b0155e975bad1bd20d69d04fc8531ec6b601cca1 authored by Martynas Pumputis on 03 June 2020, 17:02:13 UTC
WIP: daemon: Move dev detection to separate functions
Tip revision: b0155e9
Makefile.docker
# Copyright 2017-2020 Authors of Cilium
# SPDX-License-Identifier: Apache-2.0

UTC_DATE=$(shell date -u "+%Y-%m-%d")

docker-cilium-image-for-developers:
	# DOCKER_BUILDKIT allows for faster build as well as the ability to use
	# a dedicated dockerignore file per Dockerfile.
	$(QUIET)DOCKER_BUILDKIT=1 $(CONTAINER_ENGINE) build \
	     --build-arg LOCKDEBUG=\
	     --build-arg V=\
	     --build-arg LIBNETWORK_PLUGIN=\
	     -t $(DOCKER_DEV_ACCOUNT)/cilium-dev:latest . -f ./cilium-dev.Dockerfile

docker-image: clean docker-image-no-clean docker-operator-image docker-operator-aws-image docker-operator-azure-image docker-operator-generic-image docker-plugin-image docker-hubble-relay-image

docker-image-unstripped: clean docker-image-no-clean-unstripped docker-operator-image-unstripped docker-operator-aws-image-unstripped docker-operator-azure-image-unstripped docker-operator-generic-image-unstripped docker-plugin-image-unstripped docker-hubble-relay-image-unstripped

docker-image-no-clean: GIT_VERSION $(CILIUM_DOCKERFILE) build-context-update
	$(QUIET)$(CONTAINER_ENGINE) build -f $(CILIUM_DOCKERFILE) \
		--build-arg NOSTRIP=${NOSTRIP} \
		--build-arg LOCKDEBUG=${LOCKDEBUG} \
		--build-arg V=${V} \
		--build-arg LIBNETWORK_PLUGIN=${LIBNETWORK_PLUGIN} \
		--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
		-t cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
	$(QUIET)$(CONTAINER_ENGINE) tag cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
	@echo "Push like this when ready:"
	@echo "${CONTAINER_ENGINE} push cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"

docker-image-no-clean-unstripped: NOSTRIP=1
docker-image-no-clean-unstripped: UNSTRIPPED=-unstripped
docker-image-no-clean-unstripped: docker-image-no-clean

docker-cilium-manifest:
	@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium $(DOCKER_IMAGE_TAG)
	$(QUIET) contrib/scripts/push_manifest.sh cilium $(DOCKER_IMAGE_TAG)

dev-docker-image: GIT_VERSION $(CILIUM_DOCKERFILE) build-context-update
	$(QUIET)$(CONTAINER_ENGINE) build -f $(CILIUM_DOCKERFILE) \
		--build-arg NOSTRIP=${NOSTRIP} \
		--build-arg LOCKDEBUG=${LOCKDEBUG} \
		--build-arg V=${V} \
		--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
		--build-arg LIBNETWORK_PLUGIN=${LIBNETWORK_PLUGIN} \
		-t $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
	$(QUIET)$(CONTAINER_ENGINE) tag $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
	@echo "Push like this when ready:"
	@echo "${CONTAINER_ENGINE} push $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"

dev-docker-image-unstripped: NOSTRIP=1
dev-docker-image-unstripped: UNSTRIPPED=-unstripped
dev-docker-image-unstripped: dev-docker-image

docker-cilium-dev-manifest:
	@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium-dev $(DOCKER_IMAGE_TAG)
	$(QUIET) contrib/scripts/push_manifest.sh cilium-dev $(DOCKER_IMAGE_TAG)

docker-operator-image: GIT_VERSION cilium-operator$(OPERATOR_FLAVOUR).Dockerfile build-context-update
	$(QUIET)$(CONTAINER_ENGINE) build \
		--build-arg NOSTRIP=${NOSTRIP} \
		--build-arg LOCKDEBUG=${LOCKDEBUG} \
		--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
		-f cilium-operator$(OPERATOR_FLAVOUR).Dockerfile \
		-t cilium/operator$(OPERATOR_FLAVOUR)$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
	@echo "Push like this when ready:"
	@echo "${CONTAINER_ENGINE} push cilium/operator$(OPERATOR_FLAVOUR)$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"

docker-operator-image-unstripped: NOSTRIP=1
docker-operator-image-unstripped: UNSTRIPPED=-unstripped
docker-operator-image-unstripped: docker-operator-image

docker-operator-aws-image: OPERATOR_FLAVOUR=-aws
docker-operator-aws-image: docker-operator-image

docker-operator-azure-image: OPERATOR_FLAVOUR=-azure
docker-operator-azure-image: docker-operator-image

docker-operator-generic-image: OPERATOR_FLAVOUR=-generic
docker-operator-generic-image: docker-operator-image

docker-operator-manifest:
	@$(ECHO_CHECK) contrib/scripts/push_manifest.sh operator $(DOCKER_IMAGE_TAG)
	$(QUIET) contrib/scripts/push_manifest.sh operator $(DOCKER_IMAGE_TAG)

docker-plugin-image: GIT_VERSION $(DOCKER_PLUGIN_DOCKERFILE) build-context-update
	$(QUIET)$(CONTAINER_ENGINE) build \
		--build-arg NOSTRIP=${NOSTRIP} \
		--build-arg LOCKDEBUG=${LOCKDEUBG} \
		--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
		-f $(DOCKER_PLUGIN_DOCKERFILE) \
		-t cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
	$(QUIET)$(CONTAINER_ENGINE) tag cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
	@echo "Push like this when ready:"
	@echo "${CONTAINER_ENGINE} push cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"

docker-plugin-image-unstripped: NOSTRIP=1
docker-plugin-image-unstripped: UNSTRIPPED=-unstripped
docker-plugin-image-unstripped: docker-plugin-image

docker-plugin-manifest:
	@$(ECHO_CHECK) contrib/scripts/push_manifest.sh docker-plugin $(DOCKER_IMAGE_TAG)
	$(QUIET) contrib/scripts/push_manifest.sh docker-plugin $(DOCKER_IMAGE_TAG)

docker-image-runtime:
	cd contrib/packaging/docker && $(CONTAINER_ENGINE) build --build-arg ARCH=$(GOARCH) -t cilium/cilium-runtime:$(UTC_DATE) -f Dockerfile.runtime .
	$(QUIET)$(CONTAINER_ENGINE) tag cilium/cilium-runtime:$(UTC_DATE) cilium/cilium-runtime:$(UTC_DATE)-${GOARCH}

docker-cilium-runtime-manifest:
	@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium-runtime $(UTC_DATE)
	$(QUIET) contrib/scripts/push_manifest.sh cilium-runtime $(UTC_DATE)

docker-image-builder:
	$(QUIET)$(CONTAINER_ENGINE) build --build-arg ARCH=$(GOARCH) -t cilium/cilium-builder:$(UTC_DATE) -f Dockerfile.builder .
	$(QUIET)$(CONTAINER_ENGINE) tag cilium/cilium-builder:$(UTC_DATE) cilium/cilium-builder:$(UTC_DATE)-${GOARCH}

docker-cilium-builder-manifest:
	@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium-builder $(UTC_DATE)
	$(QUIET) contrib/scripts/push_manifest.sh cilium-builder $(UTC_DATE)

docker-hubble-relay-image: $(HUBBLE_RELAY_DOCKERFILE) build-context-update
	$(QUIET)$(CONTAINER_ENGINE) build \
		--build-arg NOSTRIP=${NOSTRIP} \
		--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
		-f $(HUBBLE_RELAY_DOCKERFILE) \
		-t cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
	$(QUIET)$(CONTAINER_ENGINE) tag cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
	@echo "Push like this when ready:"
	@echo "${CONTAINER_ENGINE} push cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"

docker-hubble-relay-image-unstripped: NOSTRIP=1
docker-hubble-relay-image-unstripped: UNSTRIPPED=-unstripped
docker-hubble-relay-image-unstripped: docker-hubble-relay-image
back to top