清除所有 Docker 数据以进行干净的重启。

huangapple go评论58阅读模式
英文:

clear all docker data for a clean restart

问题

I'm running a docker image of nocodb on my macbook. I chose the sqlite version. Everything works. I have made some projects and tables to test. After testing, I want to reset all this. I stopped and deleted the container, but after starting a new container, all the previous projects and tables... are still there. I want a clean restart. I tried to delete all volumes, I deleted the nocodb image and downloaded it again, but it seems like the sqlite db is somewhere on my laptop.

What I want to achieve: when I stop and delete a docker container, I want to be able to delete all associated data, so that when I restart the container, it starts from the beginning.

To run container:

ocker run -d --name nocodb \
-v "$(pwd)"/nocodb:/usr/app/data/ \
-p 8080:8080 \
nocodb/nocodb:latest

To stop/delete container:

docker stop <ID>
docker rm <ID>
docker system prune
英文:

I'm running a docker image of nocodb on my macbook. I chose the sqlite version. Everything works. I have made some projects and tables to test. After testing, I want to reset all this. I stopped and deleted the container, but after starting a new container, all the previous projects and tables... are still there. I want a clean restart. I tried to delete all volumes, I deleted the nocodb image and downloaded it again, but it seems like the sqlite db is somewhere on my laptop.

What I want to achieve: when I stop and delete a docker container, I want to be able to delete all associated data, so that when I restart the container, it starts from the beginning.

To run container:

ocker run -d --name nocodb \
-v "$(pwd)"/nocodb:/usr/app/data/ \
-p 8080:8080 \
nocodb/nocodb:latest

To stop/delete container:

docker stop <ID>
docker rm <ID>
docker system prune

答案1

得分: 2

你正在使用以下命令将数据存储在 $(pwd)/nocodb 中:

docker run -d --name nocodb \
  -v "$(pwd)"/nocodb:/usr/app/data/ \
  -p 8080:8080 \
  nocodb/nocodb:latest

要重置,你需要删除该目录中的持久数据。

英文:

You are storing your data in $(pwd)/nocodb with this command:

docker run -d --name nocodb \
  -v "$(pwd)"/nocodb:/usr/app/data/ \
  -p 8080:8080 \
  nocodb/nocodb:latest

To reset, you'll need to delete the persistent data in that directory.

答案2

得分: 1

Your data is stored in $(pwd)/nocodb. You'll need to delete this directory.

Alternatively for Docker volumes:

Running docker system prune does NOT remove volumes, for this you need to add the --volumes option. Be careful with this command, as it will delete ALL volumes, including those you might want to keep.

To delete only one specific Docker volume run docker volume rm <VOLUME NAME>.

To delete all unused volumes (unused volumes are volumes that are not referenced by any containers) run docker volume prune.

英文:

Your data is stored in $(pwd)/nocodb. You'll need to delete this directory.

Alternatively for Docker volumes:

Running docker system prune does NOT remove volumes, for this you need to add the --volumes option. Be careful with this command, as it will delete ALL volumes, including those you might want to keep.

To delete only one specific Docker volume run docker volume rm &lt;VOLUME NAME&gt;.

To delete all unused volumes (unused volumes are volumes that are not referenced by any containerts) run docker volume prune.

huangapple
  • 本文由 发表于 2023年3月31日 04:25:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75892710.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定