docker and ubuntu lab - samuel-richardson/Sam-Tech-Journal GitHub Wiki
Ubuntu
setting static ip
- edit
/etc/netplan/01-netcfg.yaml - Un the desired interface
dhcp4: no
addresses:
- 10.0.5.x
gateway4: 10.0.5.2
nameservers:
addresses: [10.0.5.5]
- Apply the netplan with
sudo netplan apply - Check IP and DNS after configuration
Adding privileged user
- add user
useradd -m username - change user password
passwd username - add user to groups
usermod -aG sudo,adm username
Docker
Usefull docker commands
- Full documentation
docker imagesshows downloaded containersDocker run 'program'runs the specified program in a container. use-rmto remove the container after run.-druns in detached mode.-Pexposes the container to all ports.docker psshows running containers.docker stop 'container'stops the specified containerdocker-compose up -drun in the directory with a docker-compose yaml file.
Reflection
In this lab, I learned how to set up a ubuntu box for use and use docker to set up applications quickly. Docker is much easier than I had initially thought.