The Complete Practical Docker Guide - MongoDB Data is Now Deleted after docker-compose Restart

The Complete Practical Docker Guide - MongoDB Data is Now Deleted after docker-compose Restart

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial explains how to create a MongoDB database and collection using Docker. It demonstrates stopping and removing Docker containers and networks, and then recreating them. The tutorial highlights the issue of data loss when containers are removed and recreated, and introduces the concept of using Docker volumes to persist data across container restarts.

Read more

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What command is used to stop all running Docker containers?

docker stop all

docker shutdown

docker compose down

docker halt

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to the containers and network when the Docker compose down command is executed?

They are completely removed

They are restarted

They are backed up

They are paused

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is the TMP database not present after restarting the containers?

The database was not saved due to new container creation

The database was moved to a different server

The database was hidden

The database was corrupted

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main reason for data loss when using Docker compose up after Docker compose down?

Incorrect Docker commands

New containers have new file systems

Network issues

Database errors

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can data be persisted in MongoDB across Docker container restarts?

By using a different database

By using Docker volumes

By increasing container memory

By using a backup script