Advanced Tokaido
Cleaning up Tokaido Environments
Tokaido manages Docker images, networks, volumes, and containers on your behalf.
The safest way to delete a Tokaido project is using tok destroy
. If you delete these Docker elements manually, then Tokaido own state can fall out-of-sync with your running Docker environment.
In cases where this happens, the recommended course of action is to clean up Docker environment and remove the projects from the Tokaido Global config file manually.
Info
These actions will not delete your Tokaido-enabled databases or require you to redownload Docker imagesStep 1 - Stop and Remove All Tokaido Containers
docker stop $(docker ps -aq --filter "label=io.tokaido.managed")
docker rm $(docker ps -aq --filter "label=io.tokaido.managed")
Step 2 - Delete all unused networks
Warning
This deletes _all_ unused networks, not just those assigned to Tokaido environmentsdocker network prune
Step 3 - Manually Delete the Proxy Compose File
rm ~/.tok/proxy/docker-compose.yml
Step 4 - Remove unwanted projects from the Global Config
nano ~/.tok/global.yml
Remove unwanted projects by deleting their "name" and "path" entries from the global config.
For example:
projects:
- name: my-project
path: /Users/mrichardson/code/my-project
- name: missing-site
path: /Users/mrichardson/code/missing-site
- name: new-site
path: /Users/mrichardson/code/new-site
To remove the 'missing-site' project from Tokaido's global config, update the global.yml file to match the following:
projects:
- name: my-project
path: /Users/mrichardson/code/my-project
- name: new-site
path: /Users/mrichardson/code/new-site