docker镜像仓库打包部署

开发环境:

打包

cd /api

docker build -t xx/xx-api:1.0.1 . 网络不稳多来几次

cd /web

docker build -t xx/xx-web:1.0.1 . 网络不稳多来几次

改tag

docker tag xx/xx-web:1.0.1 destiny_ip:5000/xx/xx-api:1.0.1

docker tag xx/xx-web:1.0.1 destiny_ip:5000/xx/xx-web:1.0.1

推送到仓库

docker push destiny_ip:5000/xx/xx-api:1.0.1

docker push destiny_ip:5000/xx/xx-web:1.0.1

传yaml文件

scp .\dify\docker\docker-compose-xxxx.yaml root@destiny_ip:/opt/dify/docker/

镜像仓库

安装

docker run -d -p 5000:5000 –restart=always –name registry registry:2

查询

curl http://localhost:5000/v2/_catalog

部署环境

拉镜像

docker pull destiny_ip:5000/xx/xx-api:1.0.1

docker pull destiny_ip:5000/xx/xx-web:1.0.1

改tag

docker tag destiny_ip:5000/xx/xx-web:1.0.1 xx/xx-api:1.0.1

docker tag destiny_ip:5000/xx/xx-web:1.0.1 xx/xx-web:1.0.1

重启

docker compose -f docker-compose-old.yaml down

docker compose -f docker-compose-new.yaml down

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注