Public | Automated Build

Last pushed: 2 years ago
Short Description
Run kubernetes locally using docker in docker (dind)
Full Description

Kubernetes - Docker-in-Docker

This recipe lets you run Kubernetes in Docker within Docker.

Forked from https://github.com/jpetazzo/dind

The purpose of this came down to a desire to quickly start a local kubernetes
cluster using hack/local-up-cluster.sh in the kubernetes source code.

There is only one requirement: your Docker version should support the
--privileged flag.

Quickstart

Build the image:

docker build -t dind-kubernetes.

then run:

docker run --privileged -t -i --net="host" dind-kubernetes

Or run the image without building:

docker run --privileged -t -i --net="host" llamashoes/dind-kubernetes

You can then make api calls to kubernetes apiserver running on <yourip>:8888

Docker Pull Command
Owner
llamashoes
Source Repository

Comments (4)
llamashoes
3 years ago

So the issue is that Docker-in-Docker (dind) needs the -it flags.

llamashoes
3 years ago

So -d works for me - running on ubuntu trusty

llamashoes
3 years ago

@fandekasp
I will take a look at it - I haven't tried running it with those flags but will give it a shot.

fandekasp
3 years ago

I have an issue when trying to run kubernetes as a daemon. While it works with -t -i, it fails with:

$ docker rm -f kubernetes; docker run --privileged -d --net="host" --name="kubernetes" llamashoes/dind-kubernetes

Please have a look at the logs.

Any idea why it keeps changing its status to success->exited->spawned and how to solve this issue?

Thanks for your help in advance