Docker-assignments
Docker-Day-1-Free-trail
### Project Scenario: Installing Docker and Validating Basic Commands
Install Docker using `yum`:
Start the Docker service:
Enable Docker to start on boot:
Check available Docker images:
Run a "Hello World" container:
Explain from where the image is downloaded:
List running containers:
List all containers (including stopped ones):
### Project Scenario: to further explore Docker by running a container, assigning a name, and validating each step:
Run "Hello World" container again
Create a new container with an assigned name
Check running containers
Check all containers (including stopped ones)
### Project Scenario: to explore Docker image search, naming conventions, and setting up a Docker Hub repository:
Search for Docker images using the `docker search` command
Explain Docker image naming convention
Create a Docker Hub repository
### Project Scenario: to pull an Nginx image, tag it, log in to Docker Hub, push the image, and verify its presence on Docker Hub
Pull the Nginx image from Docker Hub
Tag the Nginx image with `test_tag`
Log in to Docker Hub
Push the tagged Nginx image to Docker Hub
Check the image on Docker Hub
##- Docker Hub Credentials
/root/.docker/config.json
Common Issues and Fixes with `/root/.docker/config.json
Docker-Day-2
### Project Scenario: Pushing Docker Image to AWS ECR from an EC2 Instance
Create a Repository in AWS ECR
Create Security Key (Access Key and Secret Key)
Configure AWS CLI on the EC2 Instance
Authenticate the Docker CLI to AWS ECR
Tag the Docker Image
Push the Docker Image to AWS ECR
Validate the Image on AWS ECR
### Project Scenario: Managing Docker Containers Interactively and in Detached Mode
Run Docker Container in Interactive Terminal Detach Mode
Attach to the Running Docker Container
Exit the Docker Container
Stop the Docker Container
Start the Docker Container
Remove the Docker Container
### Project Scenario: Running and Managing Docker Containers in Interactive Terminal Mode
Run Docker Container in Interactive Terminal Mode
Check the OS Inside the Container
Exit the Container Without Stopping It
Attach to the Running Container
Start the Container (if stopped)
Exit the Container
### Project Scenario: Managing Docker Container by ID and Name
Run an Ubuntu Container
Find the Container ID and Name
Stop the Container Using the Container Name
Start the Container Using the Container Name
Stop the Container Using the Container ID
Start the Container Using the Container ID
Forcefully Remove a Running Container
Remove All Stopped Containers
### Project Scenario: Running NGINX in Docker on EC2 and Accessing it Externally ( PORT FARWARDING)
Run NGINX in Detached Mode
List the Running Containers
Find the IP Address and Port of the NGINX Container
Curl the IP Address of the Container
Run NGINX with Port Forwarding to EC2 Default Port
Inspect the NGINX Container to Verify the Port Mapping
Open the NGINX Port on EC2 Instance
Open the NGINX Page in Your Web Browser
### Project Scenario: Exposing NGINX on EC2 to Port 9090 Publicly and Accessing It
Run NGINX and Expose Port 9090 Publicly
Inspect the Container to Verify Port Mapping
Find the Mapped Port on the EC2 Instance
Open Port 9090 in the EC2 Security Group
Access NGINX in a Web Browser
Docker-Day-3
### Project: Managing Docker Volumes
List the Volumes
Create a Volume
Attach the Volume to a Container
Inspect the Volume
Go Inside the Container and Create a File
Check the File on the Host Node
Create a File on the Host Node and Check Inside the Container
Delete the Container and Reuse the Volume
Copy Files Between Node and Container
Difference Between Volume and `docker cp`
### Project: Persistent Jenkins Setup in Docker with Volume Management and Port Configuration
Docker-Day-4
### Project: Create Your Own Docker Image from a Running Container
### Step 1: Run a Container
#### Step 2: Update the Package Manager Inside the Container
#### Step 3: Install Vim
#### Step 4: Commit Changes to a New Image
#### Step 5: Validate the Created Image
#### Step 6: Test the New Image
### Project: Create a Docker Image Using a Dockerfile
#### Step 1: Create a Dockerfile
#### Step 2: Build the Image
#### Step 3: Run the Container and Validate Vim Installation
#### Step 4: Check All Layers of the Image
#### Step 5: Tag the Image
#### Step 6: Push to Docker Hub
#### Step 7: Push to Amazon ECR
#### Step 8: Push to JFrog
### Project: Containerize a WAR File Using Tomcat