How do you work on a container image?

Devops Devops in Devops . 2 years ago

  1   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

--Get docker images from docker hub or your docker REPOSITORY

docker PULL busybox docker pull centos docker pull divyabhushan/myrepo Divya1@Divya:~ $docker pull divyabhushan/myrepo Using default tag: latest latest: Pulling from divyabhushan/myrepo 6cf436f81810: Pull complete 987088a85b96: Pull complete b4624b3efe06: Pull complete d42beb8ded59: Pull complete d08b19d33455: Pull complete 80d9a1d33f81: Pull complete Digest: sha256:c82b4b701af5301cc5d698d963eeed46739e67aff69fd1a5f4ef0aecc4bf7bbf STATUS: Downloaded newer image for divyabhushan/myrepo:latest

--List the docker images

Divya1@Divya:~ $docker images REPOSITORY            TAG IMAGE ID            CREATED SIZE divyabhushan/myrepo   latest 72a21c221add        About an hour ago 88.1MB busybox               latest 3a093384ac30        5 weeks ago 1.2MB centos                latest 1e1148e4cc2c        2 months ago 202MB

--Create a docker container by running the docker image

--pass a shell argument  : `uname -a`

Divya1@Divya:~ $docker run centos uname -a Linux c70fc2da749a 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

--Docker images can be built by reading a dockerfile

--build a new image : ‘newrepo’ with tag:1.0 from the dockerFiles/dockerfile

docker build -t newrepo:1.1 dockerFiles/

--Now create a container from the above image:

--List all the containers

--start the container

--List only the running containers

Posted on 31 May 2022, this text provides information on Devops related to Devops in Devops. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.