Post-installation steps for Linux. Estimated reading time: 15 minutes. This section contains optional procedures for configuring Linux hosts to work better with Docker. Manage Docker as a non-root user. The Docker daemon binds to a Unix socket instead of a TCP port. Now install the newer docker-ce version from the Docker repository and containerd manually, because due to some issues, Red Hat blocked the installation of containerd.io 1.2.0-3.el7, which is a dependency of docker-ce. To install Docker on Ubuntu and Debian, you can follow this tutorial. It provides great and extensive details on how to correctly set up Docker on Linux. Again, to verify that Docker is correctly installed, you can run the following command. Step 3 – Install Docker Ubuntu. Once the repository is updated, you can install the Docker on Ubuntu by running the following command: apt-get install docker-ce -y. This command will install the latest version of Docker from the Docker official repository. Step 4 – Verify Docker Version. A minimal Ubuntu base image modified for Docker-friendliness. Baseimage-docker only consumes 8.3 MB RAM and is much more powerful than Busybox or Alpine. Baseimage-docker is a special Docker image that is configured for correct use within Docker containers. It is Ubuntu, plus: Modifications for Docker-friendliness.
Docker is a combo of ‘platform as a service’ products and services which use OS virtualisation to provide software in packages called containers.
Containers contain everything an app, tool or service needs to run, including all libraries, dependencies, and configuration files. Containers are also isolated from each other (and the underlying host system), but can communicate through pre-defined channels.
This introduction to Docker video will give you a quick top-level overview of the tech and how it works:
Because Docker is open source software it’s not only free to use, but free to adapt, extend, hack, or build on. In this guide I cover installing Docker on Ubuntu 20.04 LTS (Focal Fossa), but the same steps may also work on older versions of Ubuntu, including Ubuntu 18.04 LTS.
In this post you will learn how to install Docker from the regular Ubuntu repository, how to enable Docker to start automatically at system boot, and how to install Docker images and run them locally.
But this isn’t a deep dive. This tutorial is intentionally short and to the point. This is so you spend less time reading and more time doing.
Install Docker from Ubuntu Repository
There are two hard requirements to install Docker on Ubuntu 20.04:
- You need to have
sudo
access - You need to be connected to the internet
If you’re managing or setting up an Ubuntu server then you (probably) meet both of these requirements already, but do check before you begin.
Step 1: Install Docker from the main Ubuntu repository. Do this using the apt
command and the docker.io
package name (note: the package name is not simply ‘docker’):
Ubuntu will download the latest version of Docker from its archives, unpack it, and install it on your system.
Step 2: Make Docker start automatically on system boot:
Step 3: Test it.
Now that Docker is installed and running you should verify that everything is working okay. This can be done using the hello-world
app. From the command line run:
When you run this command you’ll see a lengthy message informing you that the ‘installation appears to be working correctly’.
But look closely at the message:
You’ll notice something interesting near the start: Docker was ‘unable to find’ the a ‘hello-world’ image. But instead of quitting it searched for and downloaded it from Docker Hub.
Which leads us neatly on to…
Step 4: Find and install Docker images.
Now you’re set-up the world (or rather the Docker ecosystem) is your oyster, and Docker Hub your port of call. Docker Hub is billed as ‘the world’s largest library and community for container images’. Any image available on Docker Hub can be installed on your system too.
Let’s look at how to do that.
To search for an image on Docker Hub run the docker
command with the search
subcommand, like so:
For example, I want to search for Alpine Linux on Docker Hub so I run docker search alpine
. A list of matching images (which match the term alpine
) will appear. I want the official Alpine image so I look in the OFFICIAL
column for the word OK
When you find the image you want to use you can download it using the pull
subcommand, For example, to install Alpine Linux I run sudo docker pull alpine
.
To run a downloaded image you need to add the run
subcommand and the name of the image, e.g., sudo docker run alpine
.
If you want to run an image as a container and get instant ‘interactive terminal’ shell access add the -it
flag. For example: I run sudo docker run -it alpine
and it drops me straight into the Alpine container, ready to work:
To exit the ‘interactive terminal’ type the word exit
and hit enter.
Check out the Docker Docs page for a wealth more info on how to use, admin, manage, and maintain your containers.
A couple of useful commands to know include docker ps -a
to list all images you’ve used (and see their container ID/name); docker stop {container id}
to close an image down; and when you’re done with a container remove it using the docker rm
command, again adding the the container ID/name at the end.
Going Further
In this guide we looked at installing Docker on Ubuntu 20.04 and getting official images installed. But this is only the beginning of what possible with Docker.
One possible avenue to explore is installing Docker rootless. This is an experimental feature and not (yet) easy to enable. But the effort required to set it up is worth it if you’re concerned about security and stability.
If there are topics you want to see a similar to-the-point tutorial on (be it Docker related or otherwise) do drop a note down in the comments or via my usual e-mail.
Today we are delighted to introduce the new Minimal Ubuntu, optimized for automated use at scale, with a tiny package set and minimal security cross-section. Speed, performance and stability are primary concerns for cloud developers and ops.
“The small footprint of Minimal Ubuntu, when deployed with fast VM provisioning from GCE, helps deliver drastically improved boot times, making them a great choice for developers looking to build their applications on Google Cloud Platform,” said Paul Nash, Group Product Manager, Google Cloud.”
Smaller and faster, for automated cloud operations
Minimal Ubuntu is the smallest Ubuntu base image for your cloud operations. These images are less than 50% the size of the standard Ubuntu server image, and boot up to 40% faster. Images of Minimal Ubuntu 16.04 LTS and 18.04 LTS are available for use now in Amazon EC2, Google Compute Engine (GCE), LXD and KVM/OpenStack.
Tiny container base image
The 29MB Docker image for Minimal Ubuntu 18.04 LTS serves as a highly efficient container starting point, and allows developers to deploy multicloud containerized applications faster. For modern Docker workflows with Kubernetes, the minimal Ubuntu image provides a balance of compatibility, familiarity, performance and size. This is the standard Ubuntu 18.04 LTS image on the Docker Hub.
Cloud images also contain the optimised kernel for each cloud and supporting boot utilities.
Fully compatible with all Ubuntu packages
While the footprint of Minimal Ubuntu is greatly reduced, it preserves full compatibility with standard Ubuntu operations. Any Ubuntu package can be installed on Minimal Ubuntu. Get exactly the image you need by simply adding your required packages, with dependencies, to a Minimal Ubuntu base image.
Minimal Ubuntu is designed for completely automated operations, with none of the usual human-friendly utilities for comfortable interactive usage. Editors, documentation, locales and other user-oriented features of Ubuntu Server have been removed. What remains are only the vital components of the boot sequence. Images still contain ssh, apt and snapd so you can connect and install any package you’re missing. The unminimize tool lets you ‘rehydrate’ your image into a familiar Ubuntu server package set, suitable for command line interaction.
Optimized for cloud hypervisors
Minimal Ubuntu uses the optimized kernels on Amazon Web Services and Google Cloud. The downloadable Minimal Ubuntu image ships with a KVM-optimised kernel and tuned for boot speed and size.
Minimized security cross-section
With fewer installed packages, Minimal Ubuntu images will avoid some security vulnerabilities and require fewer updates over time. Use of Minimal Ubuntu will reduce overall bandwidth consumption for an institution and require less storage.
Download for private clouds, published on public clouds
Minimal Ubuntu images for private clouds are available for download at http://cloud-images.ubuntu.com/minimal/releases/
Minimal Ubuntu images are available on AWS and Google Cloud.
On AWS, see the listing of minimal images at US-WEST 2 minimal images
and on Google Cloud use the SDK CLI with:
Using Minimal Images from Dockerhub
On Dockerhub, the new Ubuntu 18.04 LTS image is now the new Minimal Ubuntu 18.04 image. Launching a Docker instance with docker run ubuntu:18.04 therefore launches a Docker instance with the latest Minimal Ubuntu.
Talk to us today
Docker Post Install Ubuntu
Interested in running Ubuntu in your organisation?