Create a docker file and build a new image. Run the image and create a container.

Devops Devops in Devops . 3 years ago

  1   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
FROM divyabhushan/myrepo:latest COPY HELLO.sh /home/hello.sh CMD ["bash", "/home/hello.sh"] CMD ["echo", "Dockerfile demo"] RUN echo "dockerfile demo" >> logfile

--Build an image from the dockerfile, tag the image name as ‘mydocker’

docker build -t mydocker dockerFiles/ docker build --tag <containerName> <dockerfile location> Divya1@DIVYA:~ $docker images REPOSITORY            TAG IMAGE ID            CREATED SIZE mydocker              latest aacc2e8eb26a        20 seconds ago 88.1MB Divya1@Divya:~ $docker run mydocker /home/divya Hello Divya Bye Divya
  • View the images:
  • docker image
  • docker image --all
  • docker run -it ubuntu (imageName)
  • -i = interactive
  • -t = Allocate a sudo-tty (i.e, PROVIDE a terminal for the remote container image)

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.