Rajan Silwal
  • 👋Welcome to My Personal Page
  • Project
    • 👨‍💼Daily Activities
    • ⚠️Monitoring Tools
    • ✍️Git
    • 🏎️Automation Tools
    • 💻Virtualization
    • 🖥️Immutable Infrastructure
    • 🔶Cloud (AWS)
    • ⛲Container
  • ⚠️Monitoring Tools
    • 💡Prometheus
      • How to Setup Prometheus
      • Setup Node-exporter
      • Setup Prometheus to get metrics
    • 💡Grafana
    • 💡Nagios
  • ✍️Git
    • 🐇CI/CD in Git
      • Setup Git for CICD
  • ⛲Container
    • 📍Docker
      • Docker image
      • Same Docker image in VM
  • 🚗k8s
    • Install K8S
  • 🏎️Automation Tools
    • 🖨️Ansible
      • List of my Ansible Playbook
    • Terraform
      • Setup Terraform in AWS
      • Create VPC using .tf
      • Create EC2 using .tf
      • Command Familiars in Terraform
  • 💻Virtualization
    • 🔄OpenNebula
      • Setup OpenNebula
      • Onehost Server
      • Build VM in OpenNebula
  • 🔶Cloud (AWS)
    • 🌥️EC2
    • 🌥️IAM
    • 🌥️VPC
    • 🌥️Load Balancer
    • 🌥️S3 Bucket
    • 🌥️Route 53
  • 🖥️Immutable Infrastructure
    • 1️⃣1⃣ Content
    • 2️⃣2⃣ Virt-Install
    • 3️⃣3⃣ Base Image
    • 4️⃣4⃣ Golden-Image
    • 5️⃣5⃣ After-Golden-Image
Powered by GitBook
On this page
  1. Container
  2. Docker

Docker image

Here I am using AWS Virtual Machine to run docker. Following are the steps that I am doing in order to run a docker in VM:

In the development process I will build image in my local machine and push that image to Docker Hub. Now from docker hub We will clone that image to AWS VM.

Running Docker in Local Machine

Step 1: Download and install Docker hub in your computer, signup using your email and sign in

Step 2: Get the web app code from a developer and starting writing Dockerfile

FROM node:14-alpine

WORKDIR /app

COPY package.json . 

RUN npm install

COPY . . 

EXPOSE 80

CMD ["node", "app.js"]

Step 3: Build this dockerfile and run it using following command: docker build -t test .

Step 4: Run that build image using folloeing command: docker run -d --rm --name test1 -p 80:80 test, Here test image is running in port 80 with the name test1

Here is the final output in local machine with localhost:80

PreviousDockerNextSame Docker image in VM

Last updated 2 years ago

⛲
📍