One Day workshop on understanding Docker and Containers. Learn to run a container, inspect a container and understand the isolation of processes. Create a Dockerfile, and build an image from a Dockerfile. Learn how to mount application code using volume mount. Learn how to make your app data persistent across multiple containers. Learn how to create multiple containers from a single image, run multiple containers using docker-compose, and more.
- Machine/VM with ubuntu 22.04
- Docker
- DockerHub Account
- Git
- VS code IDE
- Stable Internet Connection and any browser.
- Check if Git, Docker, and Docker Compose are installed in on the system. Open the terminal and run the following
command
$ git --version git version 2.25.1 $ docker --version Docker version 20.10.17, build 100c701 $ docker compose version Docker Compose version v2.6.0
- Open terminal and run following command to create a folder called workshop
$ mkdir workshop
- Navigate to the folder workshop and clone the from your personal repo using git
$ cd workshop
- Clone DevOps-Workshop2 repo && go inside DevOps-Workshop2 folder
$ git clone [email protected]:UniCourt/DevOps-Workshop2.git $ cd DevOps-Workshop2
- To open folder in VS code editor
$ cd ~/workshop/DevOps-Workshop2 $ code .
- If docker is not installed in your Linux run the following command
$ sudo apt-get update $ sudo apt-get install -y curl $ curl -fsSL https://get.docker.com -o get-docker.sh $ sudo sh get-docker.sh
- Do docker login
$ sudo docker login -u username --password-stdin or $ sudo docker login -u username
- To run docker commands as normal user without sudo, we need to create a group for docker and add the user to it.
- Create the docker group
$ sudo groupadd docker
- Add your user to docker group
$ sudo usermod -aG docker $USER
- Activate the changes to groups:
$ newgrp docker
- Verify that you can run docker commands without sudo.
$ docker images or $ docker image ls
- By the end of this workshop, you will learn what docker is and understand how to set up containers.
- You will be introduced to containerization concepts and why it is required.
- You will learn how to build and run your own Containers.
- You will learn how to run Multiple Services with Docker Compose.
Time | Topics |
---|---|
09:00 - 09:30 | What is Docker? Why Docker? |
09:45 - 10:00 | Simple Docker Commands |
10:00 - 10:45 | Writing a Dockerfile |
10:45 - 11:30 | Creating Our application |
11:30 - 12:00 | Updating and sharing the App |
12:00 - 01:00 | Persisting our DB and Bind Mounts |
01:00 - 02:00 | [Break ] |
02:00 - 03:30 | Multi-Container Apps |
03:00 - 04:00 | Using Docker Compose |
04:00 - 05:00 | Image Building Best Practices |
05:00 - 05:15 | [Q & A ] |
05:15 - 05:30 | [Wrapping Up ] |