GB
  
You are currently viewing the United Kingdom version of the site.
Would you like to switch to your local site?
13 MIN READ TIME

Manage Your Docker Containers Easily

YOU’LL NEED THIS

A PC OR MAC RUNNING DOCKER

Better still, an Ubuntu-powered PC running Docker, Cockpit, and Cockpit-Docker).

LAST ISSUE WE REVEALED how to set up your own headless server running Ubuntu Server, complete with remote access via the Cockpit web-based UI. We ended by introducing you to the world of Docker and containers, which enable you to run individual applications and services within their own isolated environments for security and stability reasons.

This tutorial picks up pretty much where that feature left off—so you need to refer back if you’ve not yet installed Cockpit, Docker, or the Cockpit-Docker plugin. If you’re looking to get started with Docker on another platform, the good news is that you can run it on Windows, macOS, and other flavors of Linux, too, complete with your choice of user-friendly front end—the box on page 62 reveals some of the options available.

We’ll open by revealing how Linux users can run containers as a non-root user for security purposes, plus step you through the process of finding, downloading, setting up, and running containers on your server. We’ll even show you how to get around any missing features in Cockpit-Docker by bypassing it and using the Terminal in conjunction with your PC’s text editor to quickly get more complex containers up and running. Ready to transform your new server? Let’s get started!

1 SET UP DEDICATED DOCKER USER

Once you’ve got Docker and Cockpit-Docker (or your choice of UI) up and running, Linux users should visit https://docs.docker.com/engine/install/linux-postinstall/#manage-dockeras-a-non-root-user for a guide to managing Docker without requiring access to “sudo.” Those running Cockpit-Docker have no need to create the required “docker” group—it’s been created for you. Switch to “Accounts” in Cockpit and click your user account. A new “Container Administrator” role has been added—checking this [ImageA] adds your user to the “docker” group for the purposes of administering Docker from the command line, without having to precede commands with sudo .

>> Although Docker now supports rootless containers, which means they no longer need access to root for security purposes, they come with some restrictions that can make them impractical in all scenarios, specifically those containers that are accessed through any ports lower than 1024. Rootless Docker isn’t set up by default, although it’s simple to do in Ubuntu if you feel so obliged (see https://docs.docker.com/engine/security/rootless/).

>> An alternative workaround exists, which works on a container-by-container basis. This involves configuring each container to run using a specific user—including nonadministrators—rather than the main root account. This entails creating a dedicated user for that very purpose. Switch to Terminal in Cockpit and issue the following command: $ sudo adduser docker --ingroup docker

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for 99p
SUBSCRIBE NOW
30 day trial, then just £9.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Maximum PC
May 2021
VIEW IN STORE

Other Articles in this Issue


editorial
VIRTUAL FUTURES
Zak Storey I’VE ALWAYS had a soft spot
QUICKSTART
Rocket Lake Lands
Intel’s desktop chips finally get a new core
Rocket Lake Preparing for Launch
Jarred Walton I FIRST STARTED WRITING for Maximum PC
The Golden Age of PC Gaming
Brittany Vincent IN LAST MONTH’S TRADE CHAT, I discussed
> Thunderbolt 3 on PC > Login Problems > Moving Folders
THIS MONTH THE DOCTOR TACKLES
VIRTUAL REALITY IN 2021
VIRTUAL REALITY IN 2021
How close  to a different  reality can  virtual reality  really take us?
CRYPTOCURRENCIES
THE WORLD OF CRYPTOCURRENCIES
Digital cash, mining, and a grim look at the future of graphics cards
HISTORY OF LINUX
A POTTED HISTORY OF LINUX
Or how a 21-year-old’s bedroom  coding project took over the  world and a few other things  along the way
A COLOSSAL SECRET
A COLOSSAL SECRET
Ian Evenden discovers how British WWII  braniacs, faced with an impossible task,  helped save millions of lives and invented  the computer as we know it
R&D
HOW TO
STEP-BY-STEP GUIDES TO IMPROVING YOUR PC
AUTOPSY
THIS MONTH WE DISSECT
How to Use Photoshop Part 3
YOU’LL NEED THIS ADOBE PHOTOSHOP CC 2018 ONWARD
Encrypt Messages With Your Pi
YOU’LL NEED THIS PYTHON Any sort of computer
Emulating the Sinclair ZX Spectrum
YOU’LL NEED THIS A COPY OF RETRO VIRTUAL
BUILD IT
Virtual Renaissance
IN THE LAB
PCs Make the World Better
TESTED  REVIEWED. VERDICTIZED
Editor’s Pick: The Wrong Program
Versatility is what really makes the PC shine
Intel Core i9-11900K
Oh boy, here we go
Gigabyte Aorus 17G
Strong, mean, desktop rivaling machine?
Lenovo Legion Y25-25
IPS and 240Hz for a price you can afford
Phanteks Evolv Shift 2 Air
Super-compact madness
Vive Cosmos Elite
Where does Vive’s latest headset stand in the VR world?
Corsair K70 RGB TKL
Slick updates all around
Endgame Gear XM1 RGB Dark Frost
Raw performance and only minor niggles? We're in!
Razer Kiyo Pro
Capturing the moment
Everspace 2
In space, nobody can hear you go “YEE-HAH!”
Duolingo vs. Babbel
Learning whole new  languages online has never been easier
LETTERS
COMMENTS
WE TACKLE TOUGH READER QUESTIONS ON
BLUEPRINT
THE BUILDS
BUDGET ANOTHER MONTH of drought, another month of
Chat
X
Pocketmags Support