Blog

Docker Deployment tools

  • (4.0)
  •   |   607 Ratings

Docker deployment can frustrate most of the Docker users. However, there are tools which have been developed so as to help in solving this problem. Let us discuss some of these tools.

Learn how to use Docker, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Enroll for Free Docker Training Demo!

Captainhook

We need to demonstrate how we can use this tool so as to deploy the Docker. In the configuration directory, you should have a configuration file with the following code:
{
“scripts”: [
{
“command”: “/root/gablog.sh”,
“args”: [
“4”
]
}
]
}
Note that in the above code, we have a script named “gablosh.sh.” The following is the code for the script:
# /root/gablog.sh
if [ -z “$1” ]
then
echo “usage : gablog.sh 4 — starting four new instances”
exit -1
fi
echo “Getting the gablog containers which are currently running”
OLDPORTS=( `docker ps | grep gacademy-web | awk ‘{print $1}’` )
echo “pull the new version”
docker pull bkn/gacademy-web
echo “Launching new containers”
for j in `seq 1 $1` ; do
docker run -d -e VIRTUAL_HOST=blog.gacademy.com -p 80 bkn/gacademy-web
done
echo “remove the old containers”
for j in ${OLDPORTS[@]}
do
echo “remove the old container $j”
docker kill $j
done
The container might look complicated to some of you. However, it looks for the containers which are running, and then it stores them. For the case of the old containers, they are deleted from the system. You can then run the command given below:

                                       Checkout Docker Interview Questions

The command will launch captainhook and the configuration directory which we have specified. You can then use curl for the purpose of testing this:

                                       

A simple response from the server should be observed. The container should also be running by this time, and this can be verified by execution of the “docker ps” command. To make the script “gablog.sh” executable, use the following command:
chmod +x gablog.sh
The deployment process will give us the following:

                   

Explore Docker Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

List Of MindMajix Docker Courses:

 Kubernetes Administration
 OpenShift
 Docker Kubernetes
 OpenShift Administration

Popular Courses in 2018

Get Updates on Tech posts, Interview & Certification questions and training schedules