Skip to content

Latest commit

 

History

History
65 lines (31 loc) · 2.31 KB

File metadata and controls

65 lines (31 loc) · 2.31 KB

image

We will divide the terms into components for better understanding:

image

image

image image

  • Books on shelves = storage. They just sit there.

  • Librarian handing a book to you at checkout or mailing a book to another branch = distribution. The book is traveling from one place to another.

image

The storage step in docker image lifecycle acts as a registry

image image

image

Pulling and Running the Images:

  • For example, to run hello-world image, we can search the docker-hub to get the command: docker pull hello-world

to execute it, we will use the terminal of Docker Desktop or we can even use cmd: docker run hello-world

Now we will learn how to create an image and execute an image

NOTE: WE USED VS CODE FOR THIS DEMONSTRATION

  • Lets say we have a .py file already with us having the required code.

  • We have a requirements.txt file

  • Now we will create a Dockerfile having these things listed in it (BWCRPC) --> Base image, working dir, copy, run, port, command

AFTER HAVING ALL THE FILES READY, WE WILL OPEN THE TERMINAL AND USE THESE COMMANDS.

docker build -t hasnat5577/table .

docker run -p 5555:5000 hasnat5577/table (to check it is working on localhost)

docker login

docker push hasnat5577/laptop:latest (hasnat5577 is the namespace (username on dockerhub), laptop is the image name,
:latest is the tag)

docker pull hasnat5577/laptop:latest (after pushing it, we are going to pull it)

docker run -p 8501:8501 hasnat5577/laptop:latest