N
N
Nikolino2018-10-23 03:41:38
Docker
Nikolino, 2018-10-23 03:41:38

Can images be deleted?

Do I understand correctly that on the basis of images, an image is created, on the basis of which a container is already created?
So let's say we have:

db:
    image: mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 123456
    volumes:
      - ${DB_PATH_HOST}:/var/lib/mysql

  adminer:
    image: adminer
    restart: always
    ports:
      - 6080:8080

  composer:
    image: composer:1.6
    volumes:
      - ${APP_PATH_HOST}:${APP_PATH_CONTAINER}  
    working_dir: ${APP_PATH_CONTAINER}
    command: composer install

After docker-compose up --build, another image is created (with the name of the directory in which we build)
Since another image has been created, and we will not make any more changes, can these three images: db, adminer and composer be deleted? Or the created image depends on them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Talik, 2018-10-31
@Talik0507

Yes, you are confusing concepts.
Moreover, when you try to delete the images from which the containers are created, even if the containers are stopped, the system will swear and you will not succeed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question