Docker

共 2 篇文章

2023更新至docker 23.0.1的問題

1 分鐘閱讀

更新docker之後容器都暫停並出現以下錯誤

docker-compose up -d

Starting hexo-app ... error

ERROR: for hexo-app  Cannot start service app: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: unable to apply apparmor profile: apparmor failed to apply profile: write /proc/self/attr/apparmor/exec: no such file or directory: unknown

ERROR: for app  Cannot start service app: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: unable to apply apparmor profile: apparmor failed to apply profile: write /proc/self/attr/apparmor/exec: no such file or directory: unknown
ERROR: Encountered errors while bringing up the project.

問題在於Docker version 23.0.1, build a5ee5b1 需要apparmor 所以只要作業系統沒有安裝就會報錯

Backup mysql from docker container

1 分鐘閱讀

Introduction

為了讓想要保存下來的資料可以不會因為容器停止就蒸發掉
都會使用資料卷掛載到本地檔案系統
像Mysql的資料存放位置在/var/lib/mysql
如果需要移植到其他主機時是不能夠直接cp -r
mysql儲存的資料是會辨認主機身份,之前也發現/var/lib/mysql是不能指定在NFS這類掛載網路硬碟的位置