If you're using Docker to create and deploy containers, then you probably know the management of those containers can get a bit unwieldy after a while; this is especially true for larger deployments with numerous images and containers. One way to avoid the stress of larger-scale Docker usage is by way of a web-based GUI.
The idea of installing a GUI to manage your Docker containers might concern you, but fear not—with one command, you can get Shipyard up and running and ready to manage your containers.
SEE: Containers: The smart person's guide (TechRepublic)
What is Shipyard?
Shipyard is a web-based tool based on Docker Swarm that enables you to manage Docker resources, including containers, images, private registries, and more...all via a user-friendly GUI tool.
Oddly enough, it's built via a Docker image, so to "install" Shipyard, you use Docker. You can go about this the hard way, or you can deploy this handy tool the easy way. I'll show you the easy route, and I'll demonstrate it on the Ubuntu Server 16.04 platform with Docker already installed (which is a must).
SEE: Free ebook—The cloud v. data center decision (TechRepublic)
How to download and run Shipyard
Docker has created a simple to use script that automates the process of deploying Shipyard. Open a terminal on your Docker server and issue the following command:
curl -sSL https://shipyard-project.com/deploy | bash -s
Once the command runs, point a browser to http://SERVER_IP:8080 (SERVER_IP is the actual IP address of your server). You will be required to log in using these default credentials:
- Username - admin
- Password - shipyard
How to change the admin password
One of the first things you should do is change the admin user password. To do this, log in to Shipyard and click the ACCOUNTS tab. You will see the admin account listed (Figure A).
Click the looking glass icon in the far right column and then, in the resulting screen, enter a new password for the admin user. If you're more concerned about security, I suggest creating a new administrator account and then deleting the default admin account—just make sure you log in with your new administrator account before deleting the default. After you take care of the admin user, you can start pulling images, deploying containers, adding registries, checking nodes, and checking events.
One caveat: I have found that Shipyard doesn't seem to recognize when it is part of a Docker Swarm as either a node or a leader. To test this, I set up a quick 2-node, 1-leader swarm, and Shipyard failed to recognize the swarm. Checking the Swarm leader with the command sudo docker node ls shows the nodes and leader clearly. However, refreshing the Shipyard does not show the nodes/leaders (Figure B).
I have found a solution: Install Shipyard (as detailed above) on your Swarm leader, and then log in to one of your Swarm nodes and do the following.
- Create a new directory with the command mkdir shipyard.
- Change into the newly created directory.
- Create a file named start-node.sh with the contents below.
- Save and close the file.
- Give the file executable permissions with the command chmod u+x start-node.sh (SERVER_IP is the IP address of your Swarm leader).
- Save and close that file and issue the command sudo ./start-node.sh. This will add the node to the leader in such a way that Shipyard will be able to see it (Figure C).
#!/bin/bash # Exit upon errors. set -e # Must have root to run Shipyard. if [[ $EUID -ne 0 ]] then echo "This script must be run as root." exit 1 fi # Download Shipyard deployment script if it isn't already downloaded. if [ ! -f deploy ] then wget https://shipyard-project.com/deploy chmod +x deploy fi # Start Shipyard node. ACTION=node DISCOVERY=etcd://SERVER_IP:4001 . deploy
Follow the above steps on each of your Docker Swarm nodes, so Shipyard can detect them all.
Still more to do
The next time we visit Shipyard, we're going to talk about deploying containers with this user-friendly, web-based GUI. Until then, poke around the tool and start getting familiar with what it offers and how it works.
- Docker: The smart person's guide (TechRepublic)
- How to create a Docker swarm (TechRepublic)
- How to manage Docker containers from the command line (TechRepublic)
- How to create a docker image and push it to Docker Hub (TechRepublic)
- How to make working with docker containers easier with Simple Docker UI (TechRepublic)
- 5 tips for securing your Docker containers (TechRepublic)
- Containers vs. virtual machines: A simplified answer to a complex question (TechRepublic)
- Why containers are critical to successful DevOps projects (Tech Pro Research)
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.