Docker CE is a great way to get started using the Docker engine. It is free and open-source, but provides a high-quality container runtime. This lab will help you practice the steps involved in installing and configuring the Docker Engine. You will practice installing Docker CE and configuring a logging driver. This lab will help provide you with some basic insight into how the Docker Engine is installed and configured on systems in the real world.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install Docker CE on the server.
First, set up the Docker Repository.
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Install docker packages.
sudo apt-get update
sudo apt-get install -y docker-ce=5:18.09.5~3-0~ubuntu-bionic docker-ce-cli=5:18.09.5~3-0~ubuntu-bionic containerd.io
Verify that your installation is working.
sudo docker version
- Give cloud_user access to run Docker commands.
Add
cloud_user
to the docker group.sudo usermod -a -G docker cloud_user
Log out of the server, then log back in.
Once you are logged back on, you can verify
cloud-user
‘s access:docker version
- Set the default logging driver to syslog.
Edit
daemon.json
:sudo vi /etc/docker/daemon.json
Add configuration to
daemon.json
to set the default logging driver.{ "log-driver": "syslog" }
Restart docker.
sudo systemctl restart docker
Verify that the logging driver was set properly like so:
docker info | grep Logging
This command should return a line that says:
Logging Driver: syslog