S
S
spaceblock2017-07-11 19:23:21
WordPress
spaceblock, 2017-07-11 19:23:21

docker-compose why is data present in the newly created container?

I create containers docker-compose up - postgres does not start, writes
db_1 | initdb: directory "/var/lib/postgresql/data" exists but is not empty
db_1 | If you want to create a new database system, either remove or empty
db_1 | the directory "/var/lib/postgresql/data" or run initdb
db_1 | with an argument other than "/var/lib/postgresql/data".
Yes, before that, I spooled a fresh postgres image,
registered the connection in docker-compose.yml,
launched docker-compose up,
uploaded the database to the postgres container,
looked - ok,
docker-compose down (here I think all containers and postgres should be removed from base), but the next time docker-compose up - it gives an error, the base is in place! What is it like? Or am I misunderstanding the essence of docker?
After all, the base must be in the container, and retire with it. She that registered in image? But I didn't create my image.
============
Answer: all norms are removed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pychev Anatoly, 2019-01-10
@raebg

maybe you like it?

R
rustler2000, 2017-07-11
@spaceblock

RTFM https://docs.docker.com/compose/reference/down/ - volume is not removed by default

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question