FIX: startup issue

This commit is contained in:
Nishan
2025-04-07 19:41:22 +05:30
parent 0e2a29efd5
commit 58d44be656
2 changed files with 27 additions and 3 deletions

View File

@@ -1,8 +1,25 @@
FROM earthly/dind
RUN wget https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
RUN chmod +x kind-linux-amd64
RUN mv kind-linux-amd64 /usr/local/bin/kind
# Accept build-time architecture argument
ARG TARGETARCH
# install kind for x86_64 architecture
RUN if [ "$TARGETARCH" = "amd64" ]; then \
wget https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64 && \
chmod +x kind-linux-amd64 && \
mv kind-linux-amd64 /usr/local/bin/kind && \
echo "Building for x86_64 platform"; \
touch /amd64-ready; \
fi
# install kind for ARM64 architecture
RUN if [ "$TARGETARCH" = "arm64" ]; then \
wget https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-arm64 && \
chmod +x kind-linux-arm64 && \
mv kind-linux-arm64 /usr/local/bin/kind && \
echo "Building for ARM64 platform"; \
touch /arm64-ready; \
fi
# use our own to start kind cluster
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

View File

@@ -15,6 +15,13 @@ if [ -f "kind-config.yaml" ]; then
rm -f kind-config.yaml
fi
# Wait until kindest/node:$KIND_DEFAULT_VERSION is present
while ! docker images kindest/node | grep -q kindest/node; do
echo "Waiting for kindest/node to be available..."
sleep 5
done
echo "kindest/node is now available"
cat <<EOF > /tmp/kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4