From 2f1ac9eeba5606d65288495aff83a40c69c12abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Apayd=C4=B1n?= Date: Mon, 24 Oct 2022 17:17:54 +0300 Subject: [PATCH] chore: use ko instead of docker to minimize the image size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Batuhan Apaydın --- example/build-and-load-workload-image.sh | 5 +++-- example/workload/Dockerfile | 13 ------------- 2 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 example/workload/Dockerfile diff --git a/example/build-and-load-workload-image.sh b/example/build-and-load-workload-image.sh index 093561e..bc5c3e3 100755 --- a/example/build-and-load-workload-image.sh +++ b/example/build-and-load-workload-image.sh @@ -5,9 +5,10 @@ set -e -o pipefail DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" echo "Building the example workload image..." -docker build "$DIR"/workload -t spiffe-csi-driver-example-workload:example +cd "$DIR"/workload +KO_DOCKER_REPO=ko.local/spiffe-csi-driver-example-workload ko build --bare -t example . echo "Loading example workload image into Kind..." -kind load docker-image spiffe-csi-driver-example-workload:example +kind load docker-image ko.local/spiffe-csi-driver-example-workload:example echo "Done." diff --git a/example/workload/Dockerfile b/example/workload/Dockerfile deleted file mode 100644 index 637c88f..0000000 --- a/example/workload/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM golang:1.17-alpine - -WORKDIR /app - -COPY go.mod ./ -COPY go.sum ./ -RUN go mod download - -COPY *.go ./ - -RUN go build -o /workload - -CMD [ "/workload" ]