forked from stacksimplify/docker-fundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kalyan Reddy Daida
authored and
Kalyan Reddy Daida
committed
Feb 15, 2020
1 parent
dce1ff5
commit 2732243
Showing
4 changed files
with
28 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# Docker Introduction | ||
|
||
## What is Docker? | ||
|
||
## Why do we need to use Docker? | ||
|
||
## What are advantages of using Docker? | ||
## Docker Introduction | ||
- What problems we have with Traditional Infra? | ||
- Why do we need to use Docker? | ||
- What are advantages of using Docker? | ||
- What is Docker? | ||
- Lets have couple of hands-on exercises to understand what is Docker. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Docker Installation | ||
|
||
## Docker Installations | ||
- https://docs.docker.com/install/ | ||
|
||
## Docker Desktop on Windows | ||
- https://docs.docker.com/docker-for-windows/ | ||
|
||
## Docker Desktop on MAC | ||
- https://docs.docker.com/docker-for-mac/ | ||
|
||
## Docker Desktop on Windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,48 @@ | ||
# Docker Fundamental Flows | ||
# Flow-1: Pull Docker Image from Docker Hub and Run it | ||
|
||
## Flow-1: Pull existing Docker Image from Docker Hub and Run it as a Container | ||
|
||
#### Step-1: Verify Docker version and also login to Docker Hub | ||
## Step-1: Verify Docker version and also login to Docker Hub | ||
``` | ||
docker version | ||
docker login | ||
``` | ||
|
||
#### Step-2: Pull Image from Docker Hub | ||
## Step-2: Pull Image from Docker Hub | ||
``` | ||
docker pull stacksimplify/dockerintro-springboot-helloworld-rest-api:1.0.0-RELEASE | ||
``` | ||
|
||
#### Step-3: Run the downloaded Docker Image & Access the Application | ||
## Step-3: Run the downloaded Docker Image & Access the Application | ||
- Copy the docker image name from Docker Hub | ||
``` | ||
docker run --name app1 -p 80:8080 -d stacksimplify/dockerintro-springboot-helloworld-rest-api:1.0.0-RELEASE | ||
http://localhost/hello | ||
``` | ||
|
||
#### Step-4: List Running Containers | ||
## Step-4: List Running Containers | ||
``` | ||
docker ps | ||
docker ps -a | ||
docker ps -a -q | ||
``` | ||
|
||
#### Step-5: Connect to Container Terminal | ||
## Step-5: Connect to Container Terminal | ||
``` | ||
docker exec -it <container-name> /bin/sh | ||
``` | ||
|
||
#### Step-6: Container Stop, Start | ||
## Step-6: Container Stop, Start | ||
``` | ||
docker stop <container-name> | ||
docker start <container-name> | ||
``` | ||
|
||
#### Step-7: Remove Container | ||
## Step-7: Remove Container | ||
``` | ||
docker rm <container-name> | ||
``` | ||
|
||
### Step-8: Remove Image | ||
## Step-8: Remove Image | ||
``` | ||
docker image <image-id> | ||
``` | ||
|
||
## Flow-2: Create a new Docker Image, Run as Container and Push to Docker Hub | ||
#### Step-1: Run the base Nginx container | ||
- Access the URL http://localhost | ||
``` | ||
docker run --name mynginxdefault -p 80:80 -d nginx | ||
docker ps | ||
``` | ||
|
||
#### Step-2: Create Dockerfile and copy our customized index.html | ||
``` | ||
FROM nginx | ||
COPY index.html /usr/share/nginx/html | ||
``` | ||
|
||
#### Step-3: Build Docker Image & run it | ||
``` | ||
docker build -t stacksimplify/mynginx_image1:v1 . | ||
docker run --name mynginx1 -p 80:80 -d stacksimplify/mynginx_image1:v1 | ||
``` | ||
|
||
#### Step-4: Tag & push the Docker image to docker hub | ||
``` | ||
docker images | ||
docker tag stacksimplify/mynginx_image1:v1 stacksimplify/mynginx_image1:v1-release | ||
docker push stacksimplify/mynginx_image1:v1-release | ||
``` | ||
#### Step-5: Verify the same on docker hub | ||
- Login to docker hub | ||
- Url: https://hub.docker.com/repositories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,30 @@ | ||
# Docker Fundamental Flows | ||
# Flow-2: Create a new Docker Image, Run as Container and Push to Docker Hub | ||
|
||
## Flow-1: Pull existing Docker Image from Docker Hub and Run it as a Container | ||
|
||
#### Step-1: Verify Docker version and also login to Docker Hub | ||
``` | ||
docker version | ||
docker login | ||
``` | ||
|
||
#### Step-2: Pull Image from Docker Hub | ||
``` | ||
docker pull stacksimplify/dockerintro-springboot-helloworld-rest-api:1.0.0-RELEASE | ||
``` | ||
|
||
#### Step-3: Run the downloaded Docker Image & Access the Application | ||
- Copy the docker image name from Docker Hub | ||
``` | ||
docker run --name app1 -p 80:8080 -d stacksimplify/dockerintro-springboot-helloworld-rest-api:1.0.0-RELEASE | ||
http://localhost/hello | ||
``` | ||
|
||
#### Step-4: List Running Containers | ||
``` | ||
docker ps | ||
docker ps -a | ||
docker ps -a -q | ||
``` | ||
|
||
#### Step-5: Connect to Container Terminal | ||
``` | ||
docker exec -it <container-name> /bin/sh | ||
``` | ||
|
||
#### Step-6: Container Stop, Start | ||
``` | ||
docker stop <container-name> | ||
docker start <container-name> | ||
``` | ||
|
||
#### Step-7: Remove Container | ||
``` | ||
docker rm <container-name> | ||
``` | ||
|
||
### Step-8: Remove Image | ||
``` | ||
docker image <image-id> | ||
``` | ||
|
||
## Flow-2: Create a new Docker Image, Run as Container and Push to Docker Hub | ||
#### Step-1: Run the base Nginx container | ||
## Step-1: Run the base Nginx container | ||
- Access the URL http://localhost | ||
``` | ||
docker run --name mynginxdefault -p 80:80 -d nginx | ||
docker ps | ||
``` | ||
|
||
#### Step-2: Create Dockerfile and copy our customized index.html | ||
## Step-2: Create Dockerfile and copy our customized index.html | ||
``` | ||
FROM nginx | ||
COPY index.html /usr/share/nginx/html | ||
``` | ||
|
||
#### Step-3: Build Docker Image & run it | ||
## Step-3: Build Docker Image & run it | ||
``` | ||
docker build -t stacksimplify/mynginx_image1:v1 . | ||
docker run --name mynginx1 -p 80:80 -d stacksimplify/mynginx_image1:v1 | ||
``` | ||
|
||
#### Step-4: Tag & push the Docker image to docker hub | ||
## Step-4: Tag & push the Docker image to docker hub | ||
``` | ||
docker images | ||
docker tag stacksimplify/mynginx_image1:v1 stacksimplify/mynginx_image1:v1-release | ||
docker push stacksimplify/mynginx_image1:v1-release | ||
``` | ||
#### Step-5: Verify the same on docker hub | ||
## Step-5: Verify the same on docker hub | ||
- Login to docker hub | ||
- Url: https://hub.docker.com/repositories |