Updating BookStack Using Docker
You can use volumes within docker-compose to store your configurations for your services, including other files and databases, on the host and pass them to the container to be used - this enables you to easily remove containers and purge images without worrying about backing up your data. As personal preference, I still run manual backups using the instructions shared on the Backup BookStack Page, but you shouldn't need to worry as the data is never touched when you are updating these images - the only concern would be if the image changes the way it uses the information, in which case you may need to change some paths for the volumes within your
Run the below commands to update all services defined within your
docker-compose down docker container prune docker image prune -a #Verify you have no images left with your service, if you do, remove them. docker images -a docker-compose ps -a #Once you verify the above, you are ready to spin up your services and pull the latest images. docker-compose up -d
The above commands are more general and less specific to BookStack, and the same approach could be used to update containers for any service you are using, just be sure to persist and / or backup your data.
For this example, we run the commands to update BookStack -
user@bookstack:~/linuxserver-bookstack$ docker-compose down Stopping bookstack ... done Stopping bookstack_db ... done Removing bookstack ... done Removing bookstack_db ... done Removing network linuxserver-bookstack_default user@bookstack:~/linuxserver-bookstack$ docker image prune WARNING! This will remove all dangling images. Are you sure you want to continue? [y/N] y Deleted Images: untagged: linuxserver/bookstack@sha256:d94bdeaea3eb9d2935e38s1dcca85450cdbd144706ccb6x78a2e75f0bde07 deleted: sha256:c32f40ccc7s51e508d2x2b241a00d529a35123a18d661b1edde15aac9bfee deleted: sha256:5f2a803x93bb9fa8ab547c31d5a4f3e8520402d6425s85b53df80ebe515a9 deleted: sha256:84c9530d404015fc887c22xeecb1aebd99d2303aade5d48a2sfda044427f8 deleted: sha256:ff6dcf5097f8cfa05ff357d8axaf334c3a06259d97a6f2082cs8e7f280608 Total reclaimed space: 150.9MB user@bookstack:~/linuxserver-bookstack$ docker-compose images Container Repository Tag Image Id Size ---------------------------------------------- user@bookstack:~/linuxserver-bookstack$ docker-compose up -d Creating network "linuxserver-bookstack_default" with the default driver Creating bookstack_db ... done Creating bookstack ... done user@bookstack:~/linuxserver-bookstack$