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

  1. 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.
  2. 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
  3. Save file :wq
  4. Enter Sudo netplan apply
  5. To change hostname go to sudo vi /etc/hostname
  6. Change the name to the desired hostname
  7. Next go to sudo nano /etc/hosts
  8. Alter any old domain names to the new one and reboot
  9. Happiness 👍 now for the easy part

Docker lab

  1. Check if docker is running: systemctl status docker
  2. Check docker version: docker version
  3. Use docker run hello-world to setup the docker hello world application
  4. Check docker compose version: sudo docker-compose --version
  5. Type: docker run --rm archlinux:latest /bin/echo "HELLO SYS265 SNOW
  6. Enter: cat /etc/lsb-release (lsb is intentionally spelled)
  7. docker run -it archlinux /bin/uname -a
  8. Run: docker run -d -P training/wabapp python app.py
  9. Enter docker ps and check port
  10. Enter URL with port on a os with a GUI
  11. 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.