Lab 02: Docker Lab - FlameSpyro/Tech-Journal GitHub Wiki
Summary
This lab was very difficult to start to say the least. This was the first time I was using the Ubuntu operating system which despite being Linux threw me off a ton when compared to centos. To start the simple nmtui
command doesn't work here and requires editing of a script in order to change network credentials. To save any frustration here is a step-by-step guide on how to set up Ubuntu.
Ubuntu Setup
- Enter the command:
sudo vi /etc/netplan/*.yaml
this will bring up the script where you must CAREFULLY enter the image in the next step EXACTLY. - Fill in the following: (The parentheses are the number of spaces for each line, DO NOT ADD)
network:
(2)version: 2
(2)renderer: networkd
(2)ethernets:
(4)ens160:
(6)addresses:
(8)- your IP goes here
(6)gateway4: default gateway goes here
(6)nameservers:
(8)search: [domain name]
(8)addresses:
(8)- DNS goes here - Save file
:wq
- Enter
Sudo netplan apply
- To change hostname go to
sudo vi /etc/hostname
- Change the name to the desired hostname
- Next go to
sudo nano /etc/hosts
- Alter any old domain names to the new one and reboot
- Happiness 👍 now for the easy part
Docker lab
- Check if docker is running:
systemctl status docker
- Check docker version:
docker version
- Use
docker run hello-world
to setup the docker hello world application - Check docker compose version:
sudo docker-compose --version
- Type:
docker run --rm archlinux:latest /bin/echo "HELLO SYS265 SNOW
- Enter:
cat /etc/lsb-release
(lsb is intentionally spelled) - docker run -it archlinux /bin/uname -a
- Run:
docker run -d -P training/wabapp python app.py
- Enter
docker ps
and check port - Enter URL with port on a os with a GUI
- Install any preferred applications
Conclusion
Setting up WordPress was only tricky as you need to copy code from a notepad to putty using VIM which can be looked up super easily. The lab as stated before is super easy to set up after the ubuntu OS is set up properly. Use this future me as a guide to save you from insanity.