One Day workshop on understanding Docker and Git
Machine/VM with linux, python3 (3.xx) and pip3 installed
- Install Ubuntu 22.04 LTS from here
- Install Git from your terminal by running following commands
-
sudo apt-get update
-
sudo apt-get install git
-
- Verify the installation was successful by typing
-
git --version
-
- If you don't have the account on github then create an account on GitHub
- Configure SSH key by following the below steps
- Generating a new SSH key
- Adding your SSH key to the ssh-agent
- To list all contents of ssh folder
ls -al ~/.ssh
- To instal xclip
sudo apt install xclip
- Copy ssh key
xclip -sel clip < ~/.ssh/id_ed25519.pub
- Adding a new SSH key to your Github account
- Create a new work directory named
WORKSHOP
inside the/home
directory, by running following command in the terminal.-
mkdir WORKSHOP
-
- Fork the current repository.
- Clone your forked repository inside the
WORKSHOP
directory.
Info: You can refer this guide to understand how to fork and clone
-
To install docker follow the below mentioned steps.
-
Configure docker to run without sudo.
-
Install Docker-compose by running the follwing command:
- The following command will download the 2.16.0 release and save the executable file at /usr/local/bin/docker-compose, which will make this software globally accessible as docker-compose:
sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
- Set the correct permissions so that the docker-compose command is executable:
sudo chmod +x /usr/local/bin/docker-compose
- To verify that the installation was successful, you can run:
You’ll see output similar to this:
docker-compose --version
Docker Compose is now successfully installed on your system.Output docker-compose version 2.16.0, build 5becea4c
- The following command will download the 2.16.0 release and save the executable file at /usr/local/bin/docker-compose, which will make this software globally accessible as docker-compose:
-
Download the follwing docker images to your local machine
-
docker pull postgres:14-alpine
- Verify the image
Output: psql (PostgreSQL) 14.5
docker run --rm -ti postgres:14-alpine psql -V
- Verify the image
-
- By the end of this workshop you will understand following things
- You will be Introduced to the concept of containerisation and why its required.
- You will learn how to Build and run your own Containers.
- You will learn how to Run Multiple Services with Docker Compose
- You will learn how to Expose Ports, Volume Mounts, Utilizing Networks, Limiting Resources (the 4 features we use regularly.)
- You will be Introduced to GIT
- You will learn git commands (push, pull make Pull request etc)
Time | Topics |
---|---|
09:00 - 09:30 | [Introduction ] |
09:30 - 10:00 | Introduction to GIT |
10:00 - 11:00 | Git Commands (push, pull, make Pull request etc) |
11:00 - 11:30 | What is docker |
11:30 - 12:00 | Docker Commands |
12:00 - 01:30 | [Break ] |
01:30 - 4:00 | Building Custom Containers |
Run Multiple Services with Docker Compose |
|
4:00 - 5:00 | Expose Ports, Volume Mounts, Utilizing Networks, Limiting Resources |
5:15 - 5:30 | [Wrapping Up ] |