Skip to content

Commit 525b3e7

Browse files
committed
fix: include all src code in Dockerfile build context
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
1 parent 42f47f3 commit 525b3e7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN go mod download
1414
# Copy the go source
1515
COPY cmd/main.go cmd/main.go
1616
COPY api/ api/
17-
COPY internal/controller/ internal/controller/
17+
COPY internal/ internal/
1818

1919
# Build
2020
# the GOARCH has not a default value to allow the binary be built according to the host where the command

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# Image URL to use all building/pushing image targets
3-
IMG ?= controller:latest
3+
IMG ?= quay.io/spectrocloud-labs/validator-plugin-kubescape:latest
44
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
55
ENVTEST_K8S_VERSION = 1.27.1
66

@@ -10,6 +10,7 @@ GOBIN=$(shell go env GOPATH)/bin
1010
else
1111
GOBIN=$(shell go env GOBIN)
1212
endif
13+
GOARCH ?= $(shell go env GOARCH)
1314

1415
# CONTAINER_TOOL defines the container tool to be used for building images.
1516
# Be aware that the target commands are only tested with Docker which is
@@ -79,7 +80,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
7980
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
8081
.PHONY: docker-build
8182
docker-build: test ## Build docker image with the manager.
82-
$(CONTAINER_TOOL) build -t ${IMG} .
83+
$(CONTAINER_TOOL) build -t ${IMG} . --platform linux/$(GOARCH)
8384

8485
.PHONY: docker-push
8586
docker-push: ## Push docker image with the manager.

0 commit comments

Comments
 (0)