问题

更新 TrueNAS 到 TrueNAS-SCALE-22.12.1 后,系统的 docker 版本更新到了 23.0.2 版本,原来的 docker-compose 版本过低,运行时提示 networks.default xxx Additional properties are not allowed ('name' was unexpected),于是下载了新的 docker-compose,但是每次运行都会安装 docker,而且无法成功运行

# Executing docker install script, commit: 6647403547a96caa0a25be56051ff8b726a1b28
Warning: the "docker" command appears to already exist on this system.

If you already have Docker installed, this script can cause trouble, which is why we're displaying this warning and provide the opportunity to cancel the installation.

If you installed the current Docker package using this script and are using it again to update Docker, you can safely ignore this message.

You may press Ctrl+C now to abort this script.
+ sleep 20

解决方法

不要使用 daocloud 的镜像,直接到 github 下载就可以了

sudo curl -L "https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

docker-compose version

参考