Skip to content

UniCourt/DevOps-Workshop2-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Devops Workshop-2 Docker

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.

Prerequisites

Workshop environment setup

  • 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 .
Install Docker
  • 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

Docker without sudo

  • To run docker commands as normal user without sudo, we need to create a group for docker and add the user to it.
  1. Create the docker group
    $ sudo groupadd docker
  2. Add your user to docker group
    $ sudo usermod -aG docker $USER
  3. Activate the changes to groups:
    $ newgrp docker
  4. Verify that you can run docker commands without sudo.
    $ docker images
    or
    $ docker image ls

What will you learn by the end of this workshop?

  • 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.

Schedule

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]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published