Today a short article on the automated creation of a CentOS based Docker container-host. In a previous article I explained how you can use vRA to complete this task. Because Docker announced a two different versions of Docker, the Enterprise Edition and Community Edition, I had to make some slight changes to the script. The updated script now looks as follows:
#!/bin/bash #Install yum utils /usr/bin/yum install -y yum-utils #add docker repository /usr/bin/yum-config-manager -y --add-repo https://download.docker.com/linux/centos/docker-ce.repo #refresh yum repo and install docker engine /usr/bin/yum makecache fast -y /usr/bin/yum -y install docker-ce #configure OS /usr/bin/systemctl enable docker /usr/bin/systemctl start docker mkdir /etc/systemd/system/docker.service.d/ #enable docker remote API echo "[Service]" >> /etc/systemd/system/docker.service.d/docker.conf echo "ExecStart=" >> /etc/systemd/system/docker.service.d/docker.conf echo "ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock" >> /etc/systemd/system/docker.service.d/docker.conf /usr/bin/systemctl daemon-reload /usr/bin/systemctl restart docker
Note that this script is targeted for lab environments. The script install Docker Community Edition (docker-ce).
After a succesful deployment, you can add the deployed docker host to the containermanagement part of vRA in the following way:
In an upcoming article I will dive deeper into the container management options of vRA and how it compares to container orchestration platforms like Kubernetes and Docker Datacenter.