From d05127c171fdaaeb548ccefabdd4be3c953cfe92 Mon Sep 17 00:00:00 2001 From: jasonviviano <83607984+jasonviviano@users.noreply.github.com> Date: Tue, 24 Oct 2023 19:58:06 +0000 Subject: [PATCH] Added a condition to allow Docker to fully setup during post-create before initializing the K3d cluster --- .devcontainer/post-create.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 44826f18..26e3a7ee 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,8 +1,13 @@ #!/bin/sh ## Create a k3d cluster -k3d cluster delete -k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' +while (! kubectl cluster-info ); do + # Docker takes a few seconds to initialize + echo "Waiting for Docker to launch..." + k3d cluster delete + k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' + sleep 1 +done ## Install Dapr and init wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash