Z
Z
zlodiak2019-11-30 21:19:01
Docker
zlodiak, 2019-11-30 21:19:01

Does the container become an image?

I am confused in terminology and therefore would like to ask you to point out the errors.
1. Usually at the beginning of the Docker file there is a line like this: FROM ubuntu:latest. She requests an image from the docker hub. An image is an operating system with possibly installed software type. For example postgres, python etc.
2. The rest of the commands that go into the Dockerfile create layers . That is, each command creates a new layer. For example:

FROM python:3
ADD my_script.py /
RUN pip install pystrich
CMD [ "python", "./my_script.py" ]

3. After the user builds a docker build, a container appears (not running) :
docker build -t python-barcode .
4. After the user runs this build, a container appears running :
docker run python-barcode
5. If the user decides to share the container with the community and uploads it to the docker hub, then the container becomes an image again . Because those who download it for their project will not be able to change anything in it.
Thus, the cycle of life is as follows:
image - image with layers - container - image
Please tell me if I made a mistake in the terminology?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2019-11-30
@zlodiak

  1. right
    базовый FROM образ -- образ с доп. слоями = ваш новый образ -- контейнер и изменения -- образ с изменениями

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question