Docker - skyleroriordan/my-tech-journal GitHub Wiki

For this lab, I configured an ubuntu system to run docker.


First I added a named sudo user. adduser skyler This prompted me to create a password which I did. To add the user to the sudo group I used: usermod -aG sudo skyler

To set up a static IP I did the following. I edited the file /etc/netplan/00-installer-config.yaml to look like this: image

Then I ran netplan apply

To change the hostname I used hostnamectl to check the hostname. Then ran set-hostname docker01-skyler. I then edited the file /etc/hosts to: image

Then I edited the following line in /etc/cloud/cloud.cfg

image


Then I used these commands to install docker: sudo apt update

sudo apt install apt-transport-https ca-certificates curl 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 focal stable"

apt-cache policy docker-ce

sudo apt install docker-ce


Helpful docker commands to remember

docker-compose --version

docker run

docker version

docker images

docker run -d -p training/webapp pyhton app.py (pulls a simple pyhton web app)

docker ps

docker stop