-
How do I properly update SiYuan on Docker?
2024-10-31 04:26A bit too late to the party
I wrote a bash script to automate it. What the script does is
- pull the latest image
- stop the current container
- remove the current contianer
- create a new container with latest image
All your data is on local hard drive so you don't have to backup.
#!/bin/bash if [ `id -u` -ne 0 ] then echo "[ERROR] Run in sudo!" exit fi read -p "note password: " accessword if [ -z "${accessword}" ]; then accessword="DefaultPasswd" fi printf "\nYour password is:\n ${accessword}]\n\n" echo "[pull] pulling latest image" docker pull b3log/siyuan > /dev/null echo "[pull] done!" echo "[stop] stopping container" docker stop siyuan > /dev/null echo "[stop] done!" echo "[rm] removing container" docker rm siyuan > /dev/null echo "[rm] done!" echo "[start] starting container" docker run -d -v /srv/siyuan:/srv/siyuan -p 8088:6806 --name siyuan -u 1000:1000 -t b3log/siyuan --workspace=/path/to/siyuan/root --accessAuthCode="$accessword" > /dev/null echo "[start] done!"