Docker Client Container
This container is a generic docker client that we use to build other docker containers on CoreOS, without polluting the base host with dockerfiles and such.
In an inception-like twist, we start this container to build other containers. When starting, we should map the host's docker socket
-v /var/run/docker.sock:/var/run/docker.sock, and then all docker cli actions within the container will refer to the host, and the output of
docker build will remain on the host, not within this container.
Find out the version number for the host we want to execute this on:
wget --quiet -O - https://apt.dockerproject.org/repo/dists/debian-jessie/main/binary-amd64/Packages | grep Version: | sort
Dockerfile and insert the version number after
docker build -t communitycloud/docker-client:x.x.x.x . where x.x.x.x is the docker version built.
Finally, login into docker and push to docker hub:
docker login docker push communitycloud/docker-client
To use, run the builder container from a folder that contains the
Dockerfile of a container that needs to be built:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/build -it communitycloud/docker-client
After that, execute whatever scripts and build actions needed within the running container. The final docker build leave the container on the host, and existing the build container will get rid of all the build artifacts.