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 images shows downloaded containers
  • Docker run 'program' runs the specified program in a container. use -rm to remove the container after run. -d runs in detached mode. -P exposes the container to all ports.
  • docker ps shows running containers.
  • docker stop 'container' stops the specified container
  • docker-compose up -d run 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.