From 24158726bb83c76d06516b0f18750900f9d96f43 Mon Sep 17 00:00:00 2001 From: DanStough Date: Mon, 6 Nov 2023 12:33:04 -0500 Subject: [PATCH 1/2] chore: skaffold build experiment --- Makefile | 6 ++++++ control-plane/Dockerfile.dev | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 control-plane/Dockerfile.dev diff --git a/Makefile b/Makefile index 5626bbe99d..33b7e859a5 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,12 @@ control-plane-dev-docker: ## Build consul-k8s-control-plane dev Docker image. --build-arg 'GIT_DESCRIBE=$(GIT_DESCRIBE)' \ -f $(CURDIR)/control-plane/Dockerfile $(CURDIR)/control-plane +control-plane-dev-skaffold: ## Build consul-k8s-control-plane dev Docker image. + @$(SHELL) $(CURDIR)/control-plane/build-support/scripts/build-local.sh -o linux -a $(GOARCH) + @docker build -t '$(DEV_IMAGE)' \ + --build-arg 'TARGETARCH=$(GOARCH)' \ + -f $(CURDIR)/control-plane/Dockerfile.dev $(CURDIR)/control-plane + check-remote-dev-image-env: ifndef REMOTE_DEV_IMAGE $(error REMOTE_DEV_IMAGE is undefined: set this image to /:, e.g. hashicorp/consul-k8s-dev:latest) diff --git a/control-plane/Dockerfile.dev b/control-plane/Dockerfile.dev new file mode 100644 index 0000000000..716fde082a --- /dev/null +++ b/control-plane/Dockerfile.dev @@ -0,0 +1,5 @@ +FROM hashicorp/consul-k8s-control-plane as cache +ARG TARGETARCH + +COPY pkg/bin/linux_${TARGETARCH}/consul-k8s-control-plane /bin +COPY cni/pkg/bin/linux_${TARGETARCH}/consul-cni /bin From c24f56c772e9bda4990b0b6f471b449cbbce78af Mon Sep 17 00:00:00 2001 From: DanStough Date: Tue, 7 Nov 2023 16:58:34 -0500 Subject: [PATCH 2/2] feedback: add experiment comments --- Makefile | 4 +++- control-plane/Dockerfile.dev | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 33b7e859a5..b5c742d7cd 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,9 @@ control-plane-dev-docker: ## Build consul-k8s-control-plane dev Docker image. --build-arg 'GIT_DESCRIBE=$(GIT_DESCRIBE)' \ -f $(CURDIR)/control-plane/Dockerfile $(CURDIR)/control-plane -control-plane-dev-skaffold: ## Build consul-k8s-control-plane dev Docker image. +# DANGER: this target is experimental and could be modified/removed at any time. +# Build consul-k8s-control-plane dev Docker image for use with skaffold or local development. +control-plane-dev-skaffold: @$(SHELL) $(CURDIR)/control-plane/build-support/scripts/build-local.sh -o linux -a $(GOARCH) @docker build -t '$(DEV_IMAGE)' \ --build-arg 'TARGETARCH=$(GOARCH)' \ diff --git a/control-plane/Dockerfile.dev b/control-plane/Dockerfile.dev index 716fde082a..5da7e2a236 100644 --- a/control-plane/Dockerfile.dev +++ b/control-plane/Dockerfile.dev @@ -1,3 +1,9 @@ +# DANGER: this dockerfile is experimental and could be modified/removed at any time. +# A simple image for testing changes to consul-k8s +# +# Meant to be used with the following make target +# DEV_IMAGE= make control-plane-dev-skaffold + FROM hashicorp/consul-k8s-control-plane as cache ARG TARGETARCH