Sign inSign up

ctdc/kubectl

By ctdc

Updated over 6 years ago

A minimal Docker image based on Alpine Linux

Image
1

930

ctdc/kubectl repository overview

Kubectl image for Docker

Travis CI Docker Pulls Docker Stars Docker Build

What is kubectl

kubectl is a CLI tool to control a cluster Kubernetes.

Usage

$ docker run --rm ctdc/kubectl:latest

Get this image

The recommended way to get this Kubectl Docker Image is to pull the prebuilt image from the Docker Hub Registry.

$ docker pull ctdc/kubectl:latest

To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.

$ docker pull ctdc/kubectl:[TAG]

If you wish, you can also build the image yourself.

$ docker build -t ctdc/kubectl:latest 'https://github.com/bug-c/kubectl-docker.git#master'

Configuration

Running commands

To run commands inside this container you can use docker run, for example to execute kubectl --version you can follow the example below:

$ docker run --rm --name kubectl ctdc/kubectl:latest -- --version

Consult the Kubectl Reference Documentation to find the completed list of commands available.

Loading your own configuration

It's possible to load your own configuration, which is useful if you want to connect to a remote cluster:

$ docker run --rm --name kubectl -v /path/to/your/kube/config:/.kube/config -e="KUBECONFIG=/.kube/config" ctdc/kubectl:latest

If you need to change kube config but you don't want the changes to persist:

$ docker run --rm --name kubectl --mount type=tmpfs,destination=/.kube -v /path/to/your/kube/config:/.kube/config -e="KUBECONFIG=/.kube/config" ctdc/kubectl:latest

Example of running a custom script:

$ docker run --rm --name kubectl -v /path/to/your/kube/config:/.kube/config -v /path/to/your/script:/src -w="/src" -e="KUBECONFIG=/.kube/config" --entrypoint="/src/deploy.sh" ctdc/kubectl $SCRIPT_ARGS

Contributing

You can request new features by creating an issue, or submit a pull request with your contribution.

Issues

If you encountered a problem running this container, you can file an issue. To provide better support, be sure to include the following information in your issue:

  • Host OS and version
  • Docker version (docker version)
  • Output of docker info
  • Version of this container
  • The command you used to run the container, and any relevant output you saw (masking any sensitive information)

Thanks

Thanks to https://github.com/BuoyantIO/kubectl

Thanks to https://github.com/roffe/docker-kubectl

Thanks to https://github.com/bitnami/bitnami-docker-kubectl

Tag summary

Content type

Image

Digest

Size

29.4 MB

Last updated

over 6 years ago

docker pull ctdc/kubectl