P
P
P7472019-12-08 02:25:14
Docker
P747, 2019-12-08 02:25:14

Docker, container configuration?

Good afternoon!
Yesterday I started learning Docker, I managed to start nginx, in general, I had questions that I have not yet found in the documentation:
1. Where are the containers stored?
2. How to configure containers (for example, how to create nginx virtual hosts in docker, etc.), as if it had to be configured on Ubuntu?
3. Where is container data stored (PostgreSQL, MySQL, ElasticSearch, etc.)?
4. How to migrate along with projects to other machines, where is the package file for each project and how to create it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2019-12-08
@chupasaurus

  1. Containers on disk are layered in data-root/overlay2/(data-root is a parameter of the Docker daemon, usually /var/lib/docker)
  2. If the data is needed after the container is removed, then mount the data directory from the host. By themselves, the data that is changed inside the container lies in the same overlays, because the container, when created, creates a top layer over the image (You can see with docker inspect container_name_or_id).
  3. If everything is done correctly, then it is enough to migrate directories with container configs and data. If you do everything wrong (store data inside the container) - there is docker export/import.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question