Docker Lab - HarryNChamp/SYS-265 GitHub Wiki

Docker Lab

Just like every other system on our network, we need to configure network system, DNS records, hostname, domain suffix, named sudo user, & disable remote root SSH

On a fresh Linux system, always run sudo apt-get update

When we are setting up a non gui ubuntu system, we have to make network setting changes via files. We can do so by using these strings cd ~ cd /etc/netplan sudo vi /etc/hostname This will get us to the directory we need to reach.

the actual file we're editing is: sudo vi /etc/hosts image

sudo vi /etc/hostname will allow us to change the hostname of the system on ubuntu.

To add our docker to the realm, we'll run these commands:

sudo apt-get install realmd realm discover harrison.local

Then, we'll run these few commands to install all the tools needed to communicate with the domain.

sudo apt install sssd sssd-tools libnss-sss libpam-sss adcli samba-common-bin oddjob oddjob- mkhomedir packagekit

sudo realm join harrison.local

Test connectivity by sshing in (ssh harrison@docker01-harrison) and by pinging champlain.edy and google

To actually install the docker, follow this guide:

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

then, we'll mod our user using: sudo usermod -aG docker harrison

and we'll check the results with: su - harrison groups

To confirm docker is running, we can run: docker version

To install docker compose, run the following: sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose docker-compose --version

To check the images that are currently in docker, type: docker images

These next command (in order) print out Ubuntu version via docker, print out current docker01 linux kernel, invoke a stored ubuntu image and a bash command prompt, and print out the kernel being used by the ubuntu container

cat /etc/lsb-release echo "Current Kernal is: 4(uname -a)" docker run -it archlinux /bin/uname -a

Now, we need to open up some ports, lets run:

sudo ufw enable sudo ufw allow 32768 (I used 32768 because it's the first port that's used for outgoing connections on Linux) sudo ufw allow OpenSSH sudo ufw reload sudo ufw status

(resource used: https://www.malibal.com/guides/how-to-open-ports-on-ubuntu/)

We should now be able to connect to docker with http://docker01-harrison:32768/

One Liner for Chrome installation: $Path = $env:TEMP; $Installer = 'chrome_installer.exe'; Invoke-WebRequest -Uri 'http://dl.google.com/chrome/install/375.126/chrome_installer.exe' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args '/silent /install' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer

-Pulled from https://gist.github.com/timothywarner/5de320a3c648bd9346af8cdbd4db8d14

We used this github for the specifications of our docker setup https://github.com/docker/awesome-compose/tree/master/wordpress-mysql

sudo vi compose.yml to edit the compose configs. This is what it looked like: image

Then, all the rest can be done on WordPress!

Wrap up

Resources used to download docker were as such: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

WordPress password: HarryPressChamp26