8.5.19

Docker Basics



In this article we will discuss 
• What is docker and why?
• Basic docker commands
Why is Docker?
How many times have you tried to install a software and its dependencies and you ran into errors? This is what docker aims to solve, run a software and its dependencies seamlessly on both personal computers and cloud servers. Docker makes it easy to package and ship software.
What is Docker?
It is an application that runs packages which are called containers. A container is a package that has a software and all of its dependencies and configurations. A container is an instance of a docker image.
Basic docker commands:
• docker run hello-world [optional command override] (hello-world is the image name)
• docker ps (listing running containers)
• docker ps -all
• run = create + start
• docker create Image
• docker start ContainerId
• docker start -a Container Id (a prints out the container output to the command prompt)
• docker system prune (clear stopped containers and cache)
• docker logs ContainerId
• docker stop Container Id (SIGTERM)
• decker kill Container Id (SIGKILL)
• docker exec -it Container Id command
• docker exec -it Container Id sh
• docker run Image sh

0 comments:

Post a Comment