Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with docker volumes after service restart. #1436

Closed
fanuelsen opened this issue Oct 7, 2022 · 2 comments
Closed

Problems with docker volumes after service restart. #1436

fanuelsen opened this issue Oct 7, 2022 · 2 comments

Comments

@fanuelsen
Copy link

Version: Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1
Kernel: 5.4.0-42-generic #46-Ubuntu SMP
Distro: Ubuntu 20.04.5 LTS

I find that if i restart the docker service, docker looses track of what volumes are attached to its respective container. I'm not sure if this is as intended or a bug? But i don't find much info about this topic.

Before service restart:

docker volume ls --filter dangling=true
DRIVER    VOLUME NAME

After service restart:

docker volume ls --filter dangling=true
DRIVER    VOLUME NAME
local     0dc6d15f624c52370add08f1d47f8c1e7cdc1ee6e547c2088dd96094503a2b4c
local     3c695d69226e032dbffc66d460f36085a9ca81d159b13ed3d4d38e72ff0208ff
local     049baaafd6dfb45bde07bcfdf95eb6327f7fc87b59d96ef2f93910e649275e40
local     4927995d626010b4dc6ab9ca5cdf2c39a6750e02ccbd456eeba05b2536ca5ed6
local     772572602b9e669e38785c5e29f73bfc647012ac4c692dd95e570368995631c2
local     c6f7b4de6f2dc33ea805ef941b85d652985972bbafa28803bf3bef298c623f01
local     c492099d7d2762f3f0cf8335c1bb1b9cca380d47cf4ca31584f37949b1545245
local     chirpstack_postgresqldata
local     chirpstack_redisdata
local     crowdsec_crowdsec-config
local     crowdsec_crowdsec-db
local     d8f6bf369270ea78d9f9ab61d052b4891c970f462ea824a795305ddfcfcd10ed
local     e6ff1cae6935bb6444807cdd721ce6ae09989d44fc2b4631cbf00919157d4954
local     harbor_chartmuseum_data
local     harbor_core_data
local     harbor_harbor-adapter-trivy_data
local     harbor_jobservice_data
local     harbor_postgresql_data
local     harbor_registry_data
local     ming_grafana-data
local     ming_influxdb-data
local     ming_node-red-data
local     ming_timescale-data
local     nexus_nexus-data
local     wordpress_lhs_db
local     wordpress_lhs_wordpress

So if you happen to update your docker with apt update and the service restarts be aware that if you do a docker system prune --volumes all your "persistent" storage will be gone, even if the command says it's only gonna remove volumes not used by at least one container.

docker system prune --volumes
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all volumes not used by at least one container
  - all dangling images
  - all dangling build cache
@cpuguy83
Copy link
Collaborator

This should be fixed in 20.10.19 by moby/moby#44238

@cpuguy83
Copy link
Collaborator

Closing, but feel free to respond if this is not fixed for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants