Tools: docker setup in AWS

Tools: docker setup in AWS

Docker Container

Docker Engine

Linux VM

Install Docker on Ubuntu

Verify Docker Installation

Pull Sample Images

Important Docker Commands

Pull Image

Run Container

List Running Containers

List All Containers

Stop Container

Start Container

Remove Container

Remove Docker Image

Remove Unused Containers and Images

Running Container with Port Mapping

Port Mapping

Important Notes

Install Jenkins using Docker

Installing Jenkins Without Docker

Step 1 — Create Linux VM

Step 2 — Install Java

Step 3 — Install Jenkins

Step 4 — Start Jenkins

Step 5 — Verify Jenkins

Step 6 — Access Jenkins

Step 7 — Get Jenkins Admin Password

Step 8 — Create Admin User and Install Plugins

Example Docker Installations

SonarQube

Creating a Dockerfile

1. FROM

2. MAINTAINER (Deprecated)

3. RUN

4. CMD

Example Dockerfile

Build Docker Image

List Docker Images

Run Image

ENTRYPOINT

WORKDIR

EXPOSE

Dockerizing Spring Boot Application

Dockerfile for Spring Boot

Steps to Build and Run

Clone Repository

Build JAR

Build Docker Image

List Images

Run Container

Check Running Containers

View Logs

Access Application

Push Image to Docker Hub

Push Image Below is your content converted into a clean, well-structured Markdown (.md) document with a short analysis section at the beginning (as you requested). I also fixed spelling, formatting, headings, and diagrams so it renders nicely in GitHub, Notion, or any Markdown viewer. You can save it as: docker-notes.md Linux VM

Install Docker EngineDocker Engine acts as bridge between Linux Kernel and Docker ContainersProvides isolated environment to run Docker Images DockerfileDocker ImageDocker Registry / Docker HubDocker Container Dockerfile(Contains instructionsto download dependencies)Docker Image(Application + Dependencies)Docker Hub / Registry(Collection of images)Containers

(Container1, Container2) Practice pulling images from Docker Hub. Download image from Docker Hub. Creates and runs a container. Running a container normally: You cannot access it in a browser unless you map ports. Run container in background: Enable port 8080 in the security group. Use Ubuntu EC2 instance (t2.medium). Enable port 8080 in security group. Dockerfile instructions are case-sensitive and must be written in uppercase. Executes commands during image build. Default command when container starts. Only the last CMD instruction will run. . means Dockerfile is in the current directory. Alternative to CMD but cannot be overridden. Copies files from host to container. Similar to COPY but can extract .tar files. ADD cannot download from HTTP/S3 URLs. Sets working directory. Specifies application port. Spring Boot applications are packaged as JAR files. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command
Analysis Docker is a containerization platform that solves software compatibility issues across different environments. Instead of installing software stacks (Java, Node, Angular, etc.) separately on every server, Docker packages the application along with its dependencies into an image. This image can then run consistently on any system that has Docker installed. Key benefits include: - Eliminates compatibility issues - Simplifies deployment across multiple servers - Enables faster software upgrades - Ensures consistent environments from development to production --- # Docker

Why Docker? - Resolves **compatibility problems** using containerization. - Helps install software on different servers **without worrying about dependency conflicts**. - Allows deploying the **same application on multiple servers for load balancing** without manually installing the technology stack. - Enables **easy software upgrades across multiple machines**. ---

Important Notes ✔ **Docker Engine** acts as a bridge between the container and the host OS. ✔ Containers **do not have their own kernel**; they use the **host's kernel**. ✔ Docker Engine **manages containers but does not create them** — it runs and controls them. ---

Basic Architecture Flow # Docker Notes

Analysis Docker is a containerization platform that solves software compatibility issues across different environments. Instead of installing software stacks (Java, Node, Angular, etc.) separately on every server, Docker packages the application along with its dependencies into an image. This image can then run consistently on any system that has Docker installed. Key benefits include: - Eliminates compatibility issues - Simplifies deployment across multiple servers - Enables faster software upgrades - Ensures consistent environments from development to production --- # Docker

Why Docker? - Resolves **compatibility problems** using containerization. - Helps install software on different servers **without worrying about dependency conflicts**. - Allows deploying the **same application on multiple servers for load balancing** without manually installing the technology stack. - Enables **easy software upgrades across multiple machines**. ---

Important Notes ✔ **Docker Engine** acts as a bridge between the container and the host OS. ✔ Containers **do not have their own kernel**; they use the **host's kernel**. ✔ Docker Engine **manages containers but does not create them** — it runs and controls them. ---

Basic Architecture Flow # Docker Notes

Analysis Docker is a containerization platform that solves software compatibility issues across different environments. Instead of installing software stacks (Java, Node, Angular, etc.) separately on every server, Docker packages the application along with its dependencies into an image. This image can then run consistently on any system that has Docker installed. Key benefits include: - Eliminates compatibility issues - Simplifies deployment across multiple servers - Enables faster software upgrades - Ensures consistent environments from development to production --- # Docker

Why Docker? - Resolves **compatibility problems** using containerization. - Helps install software on different servers **without worrying about dependency conflicts**. - Allows deploying the **same application on multiple servers for load balancing** without manually installing the technology stack. - Enables **easy software upgrades across multiple machines**. ---

Important Notes ✔ **Docker Engine** acts as a bridge between the container and the host OS. ✔ Containers **do not have their own kernel**; they use the **host's kernel**. ✔ Docker Engine **manages containers but does not create them** — it runs and controls them. ---

Basic Architecture Flow --- # Docker Architecture

Components

Dockerfile Contains instructions to build a Docker image.

Docker Image Application package including: - Application code - Dependencies - Libraries - Runtime environment

Docker Registry Repository to store Docker images. Examples: - Docker Hub - Private registries

Docker Container An isolated environment where a Docker image runs. --- # What is Containerization? Containers package an application **along with its dependencies** (libraries, configuration files, etc.) ensuring it runs consistently across different computing environments. --- # Docker Architecture

Components

Dockerfile Contains instructions to build a Docker image.

Docker Image Application package including: - Application code - Dependencies - Libraries - Runtime environment

Docker Registry Repository to store Docker images. Examples: - Docker Hub - Private registries

Docker Container An isolated environment where a Docker image runs. --- # What is Containerization? Containers package an application **along with its dependencies** (libraries, configuration files, etc.) ensuring it runs consistently across different computing environments. --- # Docker Architecture

Components

Dockerfile Contains instructions to build a Docker image.

Docker Image Application package including: - Application code - Dependencies - Libraries - Runtime environment

Docker Registry Repository to store Docker images. Examples: - Docker Hub - Private registries

Docker Container An isolated environment where a Docker image runs. --- # What is Containerization? Containers package an application **along with its dependencies** (libraries, configuration files, etc.) ensuring it runs consistently across different computing environments. Example flow: Example flow: Example flow: Running inside: Running inside: Running inside: --- # Installing Docker

Install Docker on Amazon Linux ``` bash sudo yum update -y sudo yum install docker -y sudo service docker start sudo usermod -aG docker ec2-user exit --- # Installing Docker

Install Docker on Amazon Linux ``` bash sudo yum update -y sudo yum install docker -y sudo service docker start sudo usermod -aG docker ec2-user exit --- # Installing Docker

Install Docker on Amazon Linux ``` bash sudo yum update -y sudo yum install docker -y sudo service docker start sudo usermod -aG docker ec2-user exit bash sudo apt update curl -fsSL get.docker.com | /bin/bash sudo usermod -aG docker ubuntu exit bash sudo apt update curl -fsSL get.docker.com | /bin/bash sudo usermod -aG docker ubuntu exit bash sudo apt update curl -fsSL get.docker.com | /bin/bash sudo usermod -aG docker ubuntu exit bash docker -v bash docker -v bash docker -v bash docker pull psait/helloacademy:latest bash docker pull psait/helloacademy:latest bash docker pull psait/helloacademy:latest bash docker pull hello-world bash docker pull hello-world bash docker pull hello-world bash docker pull [image-name] bash docker pull [image-name] bash docker pull [image-name] bash docker run [image-name] bash docker run [image-name] bash docker run [image-name] bash docker ps bash docker ps bash docker ps bash docker ps -a bash docker ps -a bash docker ps -a bash docker stop [container-id] bash docker stop [container-id] bash docker stop [container-id] bash docker start [container-id] bash docker start [container-id] bash docker start [container-id] bash docker rm [container-id] bash docker rm [container-id] bash docker rm [container-id] bash docker rmi [image-name or image-id] bash docker rmi [image-name or image-id] bash docker rmi [image-name or image-id] bash docker system prune -a bash docker system prune -a bash docker system prune -a bash docker run [image-name] bash docker run [image-name] bash docker run [image-name] bash docker run -p host-port:container-port [image-name] bash docker run -p host-port:container-port [image-name] bash docker run -p host-port:container-port [image-name] bash docker run -p 9090:9090 [image-name] bash docker run -p 9090:9090 [image-name] bash docker run -p 9090:9090 [image-name] bash docker run -d -p 9090:9090 [image-name] bash docker run -d -p 9090:9090 [image-name] bash docker run -d -p 9090:9090 [image-name] shell http://public-ip:host-port shell http://public-ip:host-port shell http://public-ip:host-port bash docker run -d -p 8080:8080 jenkins/jenkins bash docker run -d -p 8080:8080 jenkins/jenkins bash docker run -d -p 8080:8080 jenkins/jenkins bash sudo apt update sudo apt install fontconfig openjdk-17-jre java -version bash sudo apt update sudo apt install fontconfig openjdk-17-jre java -version bash sudo apt update sudo apt install fontconfig openjdk-17-jre java -version bash sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key bash sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key bash sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key bash echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null bash echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null bash echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null bash sudo apt-get update sudo apt-get install jenkins bash sudo apt-get update sudo apt-get install jenkins bash sudo apt-get update sudo apt-get install jenkins bash sudo systemctl enable jenkins sudo systemctl start jenkins bash sudo systemctl enable jenkins sudo systemctl start jenkins bash sudo systemctl enable jenkins sudo systemctl start jenkins bash sudo systemctl status jenkins bash sudo systemctl status jenkins bash sudo systemctl status jenkins shell http://public-ip:8080 shell http://public-ip:8080 shell http://public-ip:8080 bash sudo cat /var/lib/jenkins/secrets/initialAdminPassword bash sudo cat /var/lib/jenkins/secrets/initialAdminPassword bash sudo cat /var/lib/jenkins/secrets/initialAdminPassword bash docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube:lts-community bash docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube:lts-community bash docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube:lts-community bash docker run -d -p 8081:8081 --name nexus sonatype/nexus3 bash docker run -d -p 8081:8081 --name nexus sonatype/nexus3 bash docker run -d -p 8081:8081 --name nexus sonatype/nexus3 dockerfile FROM openjdk:17 dockerfile FROM openjdk:17 dockerfile FROM openjdk:17 docker FROM python:3.9 FROM openjdk:17 FROM tomcat:9.0 docker FROM python:3.9 FROM openjdk:17 FROM tomcat:9.0 docker FROM python:3.9 FROM openjdk:17 FROM tomcat:9.0 docker MAINTAINER Name docker MAINTAINER Name docker MAINTAINER Name docker LABEL maintainer="Name " docker LABEL maintainer="Name " docker LABEL maintainer="Name " dockerfile RUN git clone RUN mvn clean package dockerfile RUN git clone RUN mvn clean package dockerfile RUN git clone RUN mvn clean package dockerfile CMD "java -jar myapp.jar" dockerfile CMD "java -jar myapp.jar" dockerfile CMD "java -jar myapp.jar" dockerfile FROM openjdk:17 MAINTAINER Hello RUN echo 'run-1' RUN echo 'run-2' CMD echo 'cmd-1' CMD echo 'cmd-2' dockerfile FROM openjdk:17 MAINTAINER Hello RUN echo 'run-1' RUN echo 'run-2' CMD echo 'cmd-1' CMD echo 'cmd-2' dockerfile FROM openjdk:17 MAINTAINER Hello RUN echo 'run-1' RUN echo 'run-2' CMD echo 'cmd-1' CMD echo 'cmd-2' bash docker build -t helloacademy/image1 . bash docker build -t helloacademy/image1 . bash docker build -t helloacademy/image1 . bash docker images bash docker images bash docker images bash docker run [image-id] bash docker run [image-id] bash docker run [image-id] docker CMD "java -jar app.jar" docker CMD "java -jar app.jar" docker CMD "java -jar app.jar" docker ENTRYPOINT ["java","-jar","app.jar"] docker ENTRYPOINT ["java","-jar","app.jar"] docker ENTRYPOINT ["java","-jar","app.jar"] dockerfile COPY target/app.jar /usr/app/ dockerfile COPY target/app.jar /usr/app/ dockerfile COPY target/app.jar /usr/app/ dockerfile ADD target/app.jar /usr/app/ dockerfile ADD target/app.jar /usr/app/ dockerfile ADD target/app.jar /usr/app/ dockerfile WORKDIR /usr/app/ dockerfile WORKDIR /usr/app/ dockerfile WORKDIR /usr/app/ dockerfile EXPOSE 8080 dockerfile EXPOSE 8080 dockerfile EXPOSE 8080 bash java -jar app.jar bash java -jar app.jar bash java -jar app.jar plaintext 8080 plaintext 8080 plaintext 8080 dockerfile FROM openjdk:17 COPY target/demo-app.jar /usr/app/ WORKDIR /usr/app/ EXPOSE 8080 ENTRYPOINT ["java","-jar","demo-app.jar"] dockerfile FROM openjdk:17 COPY target/demo-app.jar /usr/app/ WORKDIR /usr/app/ EXPOSE 8080 ENTRYPOINT ["java","-jar","demo-app.jar"] dockerfile FROM openjdk:17 COPY target/demo-app.jar /usr/app/ WORKDIR /usr/app/ EXPOSE 8080 ENTRYPOINT ["java","-jar","demo-app.jar"] bash git clone bash git clone bash git clone bash mvn clean package bash mvn clean package bash mvn clean package bash docker build -t psait/helloacademy: . bash docker build -t psait/helloacademy: . bash docker build -t psait/helloacademy: . bash docker images bash docker images bash docker images bash docker run -d -p 8080:8080 --name psa psait/helloacademy bash docker run -d -p 8080:8080 --name psa psait/helloacademy bash docker run -d -p 8080:8080 --name psa psait/helloacademy bash docker ps bash docker ps bash docker ps bash docker logs bash docker logs bash docker logs plaintext http://public-ip:8080 plaintext http://public-ip:8080 plaintext http://public-ip:8080 bash docker login bash docker login bash docker login plaintext username password plaintext username password plaintext username password bash docker push psait/helloacademy: bash docker push psait/helloacademy: bash docker push psait/helloacademy: - Enable Inbound Rules in the security group for the host port. - If running multiple containers, each must use a different host port." style="background: linear-gradient(135deg, #6a5acd 0%, #5a4abd 100%); color: #fff; border: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(106, 90, 205, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1); position: relative; overflow: hidden;">

Copy

# Docker Notes

Analysis Docker is a containerization platform that solves software compatibility issues across different environments. Instead of installing software stacks (Java, Node, Angular, etc.) separately on every server, Docker packages the application along with its dependencies into an image. This image can then run consistently on any system that has Docker installed. Key benefits include: - Eliminates compatibility issues - Simplifies deployment across multiple servers - Enables faster software upgrades - Ensures consistent environments from development to production --- # Docker

Why Docker? - Resolves **compatibility problems** using containerization. - Helps -weight: 500;">install software on different servers **without worrying about dependency conflicts**. - Allows deploying the **same application on multiple servers for load balancing** without manually installing the technology stack. - Enables **easy software upgrades across multiple machines**. ---

Important Notes ✔ **Docker Engine** acts as a bridge between the container and the host OS. ✔ Containers **do not have their own kernel**; they use the **host's kernel**. ✔ Docker Engine **manages containers but does not create them** — it runs and controls them. ---

Basic Architecture Flow # Docker Notes

Analysis Docker is a containerization platform that solves software compatibility issues across different environments. Instead of installing software stacks (Java, Node, Angular, etc.) separately on every server, Docker packages the application along with its dependencies into an image. This image can then run consistently on any system that has Docker installed. Key benefits include: - Eliminates compatibility issues - Simplifies deployment across multiple servers - Enables faster software upgrades - Ensures consistent environments from development to production --- # Docker

Why Docker? - Resolves **compatibility problems** using containerization. - Helps -weight: 500;">install software on different servers **without worrying about dependency conflicts**. - Allows deploying the **same application on multiple servers for load balancing** without manually installing the technology stack. - Enables **easy software upgrades across multiple machines**. ---

Important Notes ✔ **Docker Engine** acts as a bridge between the container and the host OS. ✔ Containers **do not have their own kernel**; they use the **host's kernel**. ✔ Docker Engine **manages containers but does not create them** — it runs and controls them. ---

Basic Architecture Flow # Docker Notes

Analysis Docker is a containerization platform that solves software compatibility issues across different environments. Instead of installing software stacks (Java, Node, Angular, etc.) separately on every server, Docker packages the application along with its dependencies into an image. This image can then run consistently on any system that has Docker installed. Key benefits include: - Eliminates compatibility issues - Simplifies deployment across multiple servers - Enables faster software upgrades - Ensures consistent environments from development to production --- # Docker

Why Docker? - Resolves **compatibility problems** using containerization. - Helps -weight: 500;">install software on different servers **without worrying about dependency conflicts**. - Allows deploying the **same application on multiple servers for load balancing** without manually installing the technology stack. - Enables **easy software upgrades across multiple machines**. ---

Important Notes ✔ **Docker Engine** acts as a bridge between the container and the host OS. ✔ Containers **do not have their own kernel**; they use the **host's kernel**. ✔ Docker Engine **manages containers but does not create them** — it runs and controls them. ---

Basic Architecture Flow --- # Docker Architecture

Components

Dockerfile Contains instructions to build a Docker image.

Docker Image Application package including: - Application code - Dependencies - Libraries - Runtime environment

Docker Registry Repository to store Docker images. Examples: - Docker Hub - Private registries

Docker Container An isolated environment where a Docker image runs. --- # What is Containerization? Containers package an application **along with its dependencies** (libraries, configuration files, etc.) ensuring it runs consistently across different computing environments. --- # Docker Architecture

Components

Dockerfile Contains instructions to build a Docker image.

Docker Image Application package including: - Application code - Dependencies - Libraries - Runtime environment

Docker Registry Repository to store Docker images. Examples: - Docker Hub - Private registries

Docker Container An isolated environment where a Docker image runs. --- # What is Containerization? Containers package an application **along with its dependencies** (libraries, configuration files, etc.) ensuring it runs consistently across different computing environments. --- # Docker Architecture

Components

Dockerfile Contains instructions to build a Docker image.

Docker Image Application package including: - Application code - Dependencies - Libraries - Runtime environment

Docker Registry Repository to store Docker images. Examples: - Docker Hub - Private registries

Docker Container An isolated environment where a Docker image runs. --- # What is Containerization? Containers package an application **along with its dependencies** (libraries, configuration files, etc.) ensuring it runs consistently across different computing environments. Example flow: Example flow: Example flow: Running inside: Running inside: Running inside: --- # Installing Docker

Install Docker on Amazon Linux ``` bash -weight: 600;">sudo -weight: 500;">yum -weight: 500;">update -y -weight: 600;">sudo -weight: 500;">yum -weight: 500;">install -weight: 500;">docker -y -weight: 600;">sudo -weight: 500;">service -weight: 500;">docker -weight: 500;">start -weight: 600;">sudo usermod -aG -weight: 500;">docker ec2-user exit --- # Installing Docker

Install Docker on Amazon Linux ``` bash -weight: 600;">sudo -weight: 500;">yum -weight: 500;">update -y -weight: 600;">sudo -weight: 500;">yum -weight: 500;">install -weight: 500;">docker -y -weight: 600;">sudo -weight: 500;">service -weight: 500;">docker -weight: 500;">start -weight: 600;">sudo usermod -aG -weight: 500;">docker ec2-user exit --- # Installing Docker

Install Docker on Amazon Linux ``` bash -weight: 600;">sudo -weight: 500;">yum -weight: 500;">update -y -weight: 600;">sudo -weight: 500;">yum -weight: 500;">install -weight: 500;">docker -y -weight: 600;">sudo -weight: 500;">service -weight: 500;">docker -weight: 500;">start -weight: 600;">sudo usermod -aG -weight: 500;">docker ec2-user exit bash -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 500;">curl -fsSL get.-weight: 500;">docker.com | /bin/bash -weight: 600;">sudo usermod -aG -weight: 500;">docker ubuntu exit bash -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 500;">curl -fsSL get.-weight: 500;">docker.com | /bin/bash -weight: 600;">sudo usermod -aG -weight: 500;">docker ubuntu exit bash -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 500;">curl -fsSL get.-weight: 500;">docker.com | /bin/bash -weight: 600;">sudo usermod -aG -weight: 500;">docker ubuntu exit bash -weight: 500;">docker -v bash -weight: 500;">docker -v bash -weight: 500;">docker -v bash -weight: 500;">docker pull psait/helloacademy:latest bash -weight: 500;">docker pull psait/helloacademy:latest bash -weight: 500;">docker pull psait/helloacademy:latest bash -weight: 500;">docker pull hello-world bash -weight: 500;">docker pull hello-world bash -weight: 500;">docker pull hello-world bash -weight: 500;">docker pull [image-name] bash -weight: 500;">docker pull [image-name] bash -weight: 500;">docker pull [image-name] bash -weight: 500;">docker run [image-name] bash -weight: 500;">docker run [image-name] bash -weight: 500;">docker run [image-name] bash -weight: 500;">docker ps bash -weight: 500;">docker ps bash -weight: 500;">docker ps bash -weight: 500;">docker ps -a bash -weight: 500;">docker ps -a bash -weight: 500;">docker ps -a bash -weight: 500;">docker -weight: 500;">stop [container-id] bash -weight: 500;">docker -weight: 500;">stop [container-id] bash -weight: 500;">docker -weight: 500;">stop [container-id] bash -weight: 500;">docker -weight: 500;">start [container-id] bash -weight: 500;">docker -weight: 500;">start [container-id] bash -weight: 500;">docker -weight: 500;">start [container-id] bash -weight: 500;">docker rm [container-id] bash -weight: 500;">docker rm [container-id] bash -weight: 500;">docker rm [container-id] bash -weight: 500;">docker rmi [image-name or image-id] bash -weight: 500;">docker rmi [image-name or image-id] bash -weight: 500;">docker rmi [image-name or image-id] bash -weight: 500;">docker system prune -a bash -weight: 500;">docker system prune -a bash -weight: 500;">docker system prune -a bash -weight: 500;">docker run [image-name] bash -weight: 500;">docker run [image-name] bash -weight: 500;">docker run [image-name] bash -weight: 500;">docker run -p host-port:container-port [image-name] bash -weight: 500;">docker run -p host-port:container-port [image-name] bash -weight: 500;">docker run -p host-port:container-port [image-name] bash -weight: 500;">docker run -p 9090:9090 [image-name] bash -weight: 500;">docker run -p 9090:9090 [image-name] bash -weight: 500;">docker run -p 9090:9090 [image-name] bash -weight: 500;">docker run -d -p 9090:9090 [image-name] bash -weight: 500;">docker run -d -p 9090:9090 [image-name] bash -weight: 500;">docker run -d -p 9090:9090 [image-name] shell http://public-ip:host-port shell http://public-ip:host-port shell http://public-ip:host-port bash -weight: 500;">docker run -d -p 8080:8080 jenkins/jenkins bash -weight: 500;">docker run -d -p 8080:8080 jenkins/jenkins bash -weight: 500;">docker run -d -p 8080:8080 jenkins/jenkins bash -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install fontconfig openjdk-17-jre java -version bash -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install fontconfig openjdk-17-jre java -version bash -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install fontconfig openjdk-17-jre java -version bash -weight: 600;">sudo -weight: 500;">wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key bash -weight: 600;">sudo -weight: 500;">wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key bash -weight: 600;">sudo -weight: 500;">wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key bash echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | -weight: 600;">sudo tee \ /etc/-weight: 500;">apt/sources.list.d/jenkins.list > /dev/null bash echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | -weight: 600;">sudo tee \ /etc/-weight: 500;">apt/sources.list.d/jenkins.list > /dev/null bash echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | -weight: 600;">sudo tee \ /etc/-weight: 500;">apt/sources.list.d/jenkins.list > /dev/null bash -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install jenkins bash -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install jenkins bash -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install jenkins bash -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable jenkins -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start jenkins bash -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable jenkins -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start jenkins bash -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable jenkins -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start jenkins bash -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status jenkins bash -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status jenkins bash -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status jenkins shell http://public-ip:8080 shell http://public-ip:8080 shell http://public-ip:8080 bash -weight: 600;">sudo cat /var/lib/jenkins/secrets/initialAdminPassword bash -weight: 600;">sudo cat /var/lib/jenkins/secrets/initialAdminPassword bash -weight: 600;">sudo cat /var/lib/jenkins/secrets/initialAdminPassword bash -weight: 500;">docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube:lts-community bash -weight: 500;">docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube:lts-community bash -weight: 500;">docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube:lts-community bash -weight: 500;">docker run -d -p 8081:8081 --name nexus sonatype/nexus3 bash -weight: 500;">docker run -d -p 8081:8081 --name nexus sonatype/nexus3 bash -weight: 500;">docker run -d -p 8081:8081 --name nexus sonatype/nexus3 dockerfile FROM openjdk:17 dockerfile FROM openjdk:17 dockerfile FROM openjdk:17 -weight: 500;">docker FROM python:3.9 FROM openjdk:17 FROM tomcat:9.0 -weight: 500;">docker FROM python:3.9 FROM openjdk:17 FROM tomcat:9.0 -weight: 500;">docker FROM python:3.9 FROM openjdk:17 FROM tomcat:9.0 -weight: 500;">docker MAINTAINER Name <email> -weight: 500;">docker MAINTAINER Name <email> -weight: 500;">docker MAINTAINER Name <email> -weight: 500;">docker LABEL maintainer="Name <email>" -weight: 500;">docker LABEL maintainer="Name <email>" -weight: 500;">docker LABEL maintainer="Name <email>" dockerfile RUN -weight: 500;">git clone <repo-url> RUN mvn clean package dockerfile RUN -weight: 500;">git clone <repo-url> RUN mvn clean package dockerfile RUN -weight: 500;">git clone <repo-url> RUN mvn clean package dockerfile CMD "java -jar myapp.jar" dockerfile CMD "java -jar myapp.jar" dockerfile CMD "java -jar myapp.jar" dockerfile FROM openjdk:17 MAINTAINER Hello RUN echo 'run-1' RUN echo 'run-2' CMD echo 'cmd-1' CMD echo 'cmd-2' dockerfile FROM openjdk:17 MAINTAINER Hello RUN echo 'run-1' RUN echo 'run-2' CMD echo 'cmd-1' CMD echo 'cmd-2' dockerfile FROM openjdk:17 MAINTAINER Hello RUN echo 'run-1' RUN echo 'run-2' CMD echo 'cmd-1' CMD echo 'cmd-2' bash -weight: 500;">docker build -t helloacademy/image1 . bash -weight: 500;">docker build -t helloacademy/image1 . bash -weight: 500;">docker build -t helloacademy/image1 . bash -weight: 500;">docker images bash -weight: 500;">docker images bash -weight: 500;">docker images bash -weight: 500;">docker run [image-id] bash -weight: 500;">docker run [image-id] bash -weight: 500;">docker run [image-id] -weight: 500;">docker CMD "java -jar app.jar" -weight: 500;">docker CMD "java -jar app.jar" -weight: 500;">docker CMD "java -jar app.jar" -weight: 500;">docker ENTRYPOINT ["java","-jar","app.jar"] -weight: 500;">docker ENTRYPOINT ["java","-jar","app.jar"] -weight: 500;">docker ENTRYPOINT ["java","-jar","app.jar"] dockerfile COPY target/app.jar /usr/app/ dockerfile COPY target/app.jar /usr/app/ dockerfile COPY target/app.jar /usr/app/ dockerfile ADD target/app.jar /usr/app/ dockerfile ADD target/app.jar /usr/app/ dockerfile ADD target/app.jar /usr/app/ dockerfile WORKDIR /usr/app/ dockerfile WORKDIR /usr/app/ dockerfile WORKDIR /usr/app/ dockerfile EXPOSE 8080 dockerfile EXPOSE 8080 dockerfile EXPOSE 8080 bash java -jar app.jar bash java -jar app.jar bash java -jar app.jar plaintext 8080 plaintext 8080 plaintext 8080 dockerfile FROM openjdk:17 COPY target/demo-app.jar /usr/app/ WORKDIR /usr/app/ EXPOSE 8080 ENTRYPOINT ["java","-jar","demo-app.jar"] dockerfile FROM openjdk:17 COPY target/demo-app.jar /usr/app/ WORKDIR /usr/app/ EXPOSE 8080 ENTRYPOINT ["java","-jar","demo-app.jar"] dockerfile FROM openjdk:17 COPY target/demo-app.jar /usr/app/ WORKDIR /usr/app/ EXPOSE 8080 ENTRYPOINT ["java","-jar","demo-app.jar"] bash -weight: 500;">git clone <repo-url> bash -weight: 500;">git clone <repo-url> bash -weight: 500;">git clone <repo-url> bash mvn clean package bash mvn clean package bash mvn clean package bash -weight: 500;">docker build -t psait/helloacademy:<tag> . bash -weight: 500;">docker build -t psait/helloacademy:<tag> . bash -weight: 500;">docker build -t psait/helloacademy:<tag> . bash -weight: 500;">docker images bash -weight: 500;">docker images bash -weight: 500;">docker images bash -weight: 500;">docker run -d -p 8080:8080 --name psa psait/helloacademy bash -weight: 500;">docker run -d -p 8080:8080 --name psa psait/helloacademy bash -weight: 500;">docker run -d -p 8080:8080 --name psa psait/helloacademy bash -weight: 500;">docker ps bash -weight: 500;">docker ps bash -weight: 500;">docker ps bash -weight: 500;">docker logs <container-id> bash -weight: 500;">docker logs <container-id> bash -weight: 500;">docker logs <container-id> plaintext http://public-ip:8080 plaintext http://public-ip:8080 plaintext http://public-ip:8080 bash -weight: 500;">docker login bash -weight: 500;">docker login bash -weight: 500;">docker login plaintext username password plaintext username password plaintext username password bash -weight: 500;">docker push psait/helloacademy:<tag> bash -weight: 500;">docker push psait/helloacademy:<tag> bash -weight: 500;">docker push psait/helloacademy:<tag> - Enable Inbound Rules in the security group for the host port. - If running multiple containers, each must use a different host port.