Lab 02 Docker - AdieStevens/SYS-265 GitHub Wiki

Key Notes

  • First we needed to give our ubuntu box a static IP which is different than before when we could just use nmtui
  • We had to go into our text editor nano and go to our file "/etc/netplan/00-install-config.yaml" once in there under "address" type "- ip address/24"
  • then "sudo netplan apply"
  • you also want to apply dhcp so you would want to type over from dhcp4: "true"
  • then again "sudo netplan apply"
  • to change host name it would just be "sudo hostname 'new-hostname'" you might have to reboot to see new hostname
  • then same as usual add it to your records on AD.
  • other than that we just followed instructions to install and use docker on ubuntu
  • we had to create a sudo user and make sure that it could access the docker so that looks like "usermod -aG 'user' docker"
  • "docker images" will show you your images where they are size etc.
  • It is important to know that your docker is in its own environment so they will not be on the same linux OS as your host would
  • "docker ps" will show you what port your docker uses
  • "docker stop 'image name'" will delete that image.
  • using the "docker ps" we can take our portt we use and type in our domain name "docker01-adie:xxxx" and browse to our docker through mgmt01-adie.
  • Then we did our wordpress through docker which was tricky because the docker syntax is very specific and you have to make sure everything is perfect
  • The main things to look at for this is NO indentations, make sure your ports are valid and make sure you are using the right version.

Some Docker Commands (extras that I did not include above^)

  • docker -P : this is used to map a host port to a container port when running a docker container
  • docker -d : is used to run a docker container in the background as a daemon
  • docker-compose up -d : this command is used to start a docker compose application in the background. The 'up' creates and start the containers in our 'docker-compose.yaml' file while the -d runs the containers as daemon processes in the background.

Troubleshooting

  • Cabling as always (make sure connected to LAN)
  • setting up network can be tricky google is your best friend
  • You will not be able to access docker in sudo user if you forget to add user to docker group
  • CHECK syntax in your docker-compose file, no indentations, correct version and ports