Same Docker image in VM

Running same image in AWS Virtal Machine

Inorder to run the same image in VM we need to do following steps: Step 1: Create a repository in docker hub with name and push the image image to docker hub

Step 2: Once you create a repository, please login through terminal as well.

Step 3: Now, need to tag our image to our private repository: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG] Ex: docker tag test rajansilwal04/first_test:tagname

Step 4: Need to push our image to repository: Ex: docker push rajansilwal04/first_test:tagname

Step 5. Create a EC2 instances (https://app.gitbook.com/o/Sl85xsDKUHFlvowLtBga/s/9wnMXVEmEJ7k6VEhLJYN/~/changes/aNCytkzQw3O9d4ixbcKU/cloud-aws/opennebula)

Step 6: Install Docker on Linux --> yum install docker -y

Step 7: Now, start the docker --> sudo docker start

Step 8: Since our repository is public so we can pull that image directly from internet: Ex: sudo docker run -d --rm --name test1 -p 80:80 rajansilwal04/first_test:tagname

Last updated