Skip to content

Instantly share code, notes, and snippets.

@dims
Last active February 12, 2024 20:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dims/ac6153c1c9d07a3d2b597c4b8cb86c35 to your computer and use it in GitHub Desktop.
Save dims/ac6153c1c9d07a3d2b597c4b8cb86c35 to your computer and use it in GitHub Desktop.
Drop into the shell inside kubekins-e2e container
# DO NOT TRY THIS ON A MAC or WSL2 :) use a ubuntu vm or something!
# Run the same kubekins container used in the CI job
IMAGE=gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240209-82001bc8c5-main
# Create a temp directory for the DIND docker - see the baked in assumption in some of our images here - https://cs.k8s.io/?q=docker-graph&i=nope&files=&excludeFiles=&repos=kubernetes/test-infra
(sudo mkdir -p /tmp/docker-graph && sudo chmod -R 777 /tmp/docker-graph && cd /tmp/docker-graph && rm -rf *)
# Run as a privileged container, mount both the kubernetes directory and the docker-graph directory
docker run -e DOCKER_IN_DOCKER_ENABLED=true \
--privileged --rm \
--entrypoint=/bin/bash \
-it \
-v /tmp/docker-graph:/docker-graph \
-v $HOME/go/src/k8s.io/kubernetes:/go/src/k8s.io/kubernetes \
$IMAGE -c "cd /go/src/k8s.io/kubernetes; /bin/bash"
# inspect the contents of /usr/local/bin/runner.sh as that is the main script that gets launched usually in CI job
# in the docker command above you can see that we skip that with an explicit entrypoint to /bin/bash
# Example to start docker you can do the following in the prompt the docker command above drop you into
service docker start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment