Bobcares

For every $500 you spend, we will provide you with a $500 credit on your account*

BLACK FRIDAY SPECIAL

*The maximum is $4000 in credits, Offer valid till December 6th, 2024, New Customers Only, Credit will be applied after purchase and expires after six (6) months

For every $500 you spend, we will provide you with a $500 credit on your account*

BLACK FRIDAY SPECIAL

*The maximum is $4000 in credits, Offer valid till December 6th, 2024, New Customers Only, Credit will be applied after purchase and expires after six (6) months

Docker management simplified – How to use Cockpit to deploy and manage Docker containers

by | Aug 24, 2015

1. Docker installed – Check.
2. Get image – Check.
3. Deploy container – Check.

With Docker, deployment is as easy as that. Sysadmins and developers have moved away from the VPS days, and have settled into the easy lives of getting deployments done in minutes rather than hours. But now we’ve grown more ambitious – How do we manage multiple Docker containers more efficiently? Enter the Cockpit project from Red Hat.

Cockpit as a Docker Management UI

Cockpit is a browser based server manager, which allows sysadmins to carry out simple server management functions like resource allocation, container deployment, image download, etc. through an intuitive UI. The Fedora package of Cockpit has a built-in Docker integration which makes Docker container management over multiple servers quite easy.

Cockpit is available out of the box with Docker integration in Fedora Server, CentOS Atomic, Fedora Atomic, Red Hat Enterprise 7.1+ extras repo, and Arch Linux User repo. Fedora 22 server comes pre-loaded with Cockpit and Docker, but even if your server doesn’t have it, its a straight forward install with the following commands:

# dnf update
# dnf install docker
# dnf install cockpit

Start the Cockpit server by using the below commands:

# systemctl enable cockpit.socket
# systemctl start cockpit
# firewall-cmd --add-service=cockpit
# setenforce 0

In the default configuration, Cockpit should be available in port 9090. So, you can access Cockpit management console with the URL https://[YOUR-SERVER-IP]:9090. Login with your admin login details. You can see your server resource statistics, and control functions.

Cockpit login screen to manage Docker containers

Cockpit login screen

cockpit-system-management-screen

Cockpit system management screen

 

Docker management with Cockpit

Docker integration is pre-built with Cockpit in Fedora. So, when you login to Cockpit, you’ll see the “Containers” link on the left pane visible. Clicking on it will lead you to the Docker management console, where you can start Docker server, get new images, start new containers, manage resources and manage instances.

Getting (Pulling) Docker images

Under the “Images” section, you have the option to “Get new image”. This launches an “Image search” window where you can see all published images in Docker Hub. I pulled the Tutum WordPress container, which looked like this:

Pulling new images from Cockpit Docker Management UI

Pulling new Docker images from Cockpit UI

Starting a Docker container

Once you have the image, just click the run icon in the “Images” section, and a “Run Image” dialog pops up to configure the container resource allocation and port assignment. For each container, you can bind their service ports to the host server ports as shown below. This allows you to run multiple Docker containers for different apps on different ports, and then link them all to a single load balancer front end. Click “Run” and your container comes to life.

Running a container from Docker Management UI

Running Docker container from Cockpit

Resource usage monitoring

You can see the resources used by your Docker containers by going to the Container management screen. A snapshot is shown below:

Docker Management UI

Docker container management UI in Cockpit

Resource management

If you notice the CPU or memory usage of a container causing instability to the host server, you can change its resource allocation. Click on the container to show its management console.

Docker container management screen

Docker container management screen

Click on “Change resource limits” to adjust the resource allocation of the container.

Docker container resource management

Docker container resource management

The container management screen also gives you the options to Stop, Restart and Delete the container. For Docker images enabled with terminals, you get an option to issue terminal commands via this management screen.

Go ahead and try out Cockpit today. As we’ve seen in a previous post, Cockpit can save you time in configuration management, and help you optimize deployment, monitoring, and a range of other DevOps activities.

 

Bobcares server administrators routinely help webmasters and service providers configure their infrastructure and keep their servers secure and responsive. Our server management services cover 24/7 monitoring, emergency administration, periodic security hardening, periodic performance tuning and server updates.

SEE HOW YOU CAN SETUP A RELIABLE SERVER INFRASTRUCTURE

 

Bobcares provides Outsourced Hosting Support and Outsourced Server Management for online businesses. Our services include Hosting Support Services, server support, help desk support, live chat support and phone support. var google_conversion_label = "owonCMyG5nEQ0aD71QM";

2 Comments

  1. M.Sonah

    Hi, what do you mean by?

    #dnf update

    I tried running that on server it results:

    # -bash: dnf: command not found

    Reply
    • Visakh

      Hi M Sonah,

      Are you using Fedora 22?

      DNF is the replacement to Yum.

      In older systems, use Yum.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF