Basic build tools docker images + docker & kubectl for use in CI/CD environments
5.8K
These are basic docker images starting from official OS base images, and installing build-essential packages, docker and kubectl. Intended for use when building & deploying containerized applications to Kubernetes in a Continuous Deployment pipeline.
dockerkubectlSee Dockerfiles for kubectl version (K8S_VERSION).
Please also see the documentation for the base image: trinitronx/build-tools
Note: imagelayers.io may not be working properly. If in doubt, check the Docker Hub page under "tags", or download the images yourself to inspect via docker images or docker inspect.
trinitronx/kubectl-cd:ubuntu-1604: trinitronx/kubectl-cd:ubuntu-1404: trinitronx/kubectl-cd:ubuntu-1204: trinitronx/kubectl-cd:centos-7: trinitronx/kubectl-cd:centos-6: trinitronx/kubectl-cd:alpine-3.6: Because ENTRYPOINT is set to kubectl you should run the container just the same as you would with the kubectl executable:
docker run trinitronx/kubectl-cd
If you did not specify --server or --kubeconfig=/path/to/.kube/config, kubectl will default to localhost:8080.
This will work if kube-apiserver is running on your docker host at localhost:8080. However, you will need to call docker with --net=host:
docker run --rm --net=host trinitronx/kubectl-cd
If kube-apiserver is not running on your build host at localhost:8080, you can use --server to specify a server, or if you have ~/.kube/config you may volume mount that into the container:
docker run --rm -v ~/.kube:/root/.kube trinitronx/kubectl-cd
It may be helpful to create a shell alias to make it appear as if you are running the local executable:
alias kubectl='docker run --rm -it -u $(id -u) -e HOME=${HOME} -v ${HOME}:${HOME} trinitronx/kubectl-cd'
This creates a shortcut to run trinitronx/kubectl-cd as if it were the bare kubectl binary. So you may run commands such as:
kubectl get pods
Note the --rm in the above examples. This option automatically causes docker to remove the old containers after the command exits as with docker rm. This will prevent old containers from building up each time you run kubectl.
The commands above will use the trinitronx/kubectl-cd:latest tag to provide the latest pushed docker image based on alpine Linux. However, you may specify an explicit os & version by tag. This may be helpful in controlled environments to avoid kubectl client & kube-apiserver version incompatibility. For example, to run kubectl version 1.2.3 based on alpine:
docker run --rm trinitronx/kubectl-cd:1.2.3
To run kubectl version 1.2.3 based on ubuntu-1604:
docker run --rm trinitronx/kubectl-cd:ubuntu-1604-kubectl-1.2.3
The image tags are created from the K8S_VERSION variable detected from the built Dockerfile.
To build the images locally, checkout this repo and run:
make build
# OR:
./bin/docker-build
This repo contains basic bats tests to check the built images for the binaries installed.
To run the tests:
make test
See LICENSE.md for full text
Copyright James Cuzella 2014-2017 (@trinitronx)
Content type
Image
Digest
Size
96.1 MB
Last updated
over 9 years ago
docker pull trinitronx/kubectl-cd