gpt4 book ai didi

docker-compose down 不会.. "down"容器

转载 作者:行者123 更新时间:2023-12-04 01:35:29 26 4
gpt4 key购买 nike

我有几个系统使用 docker-compose 并且没有问题。

但是,我在这里有一个“向下”根本不做任何事情的地方。
'up'虽然完美。这是在 MacOS 上。

该项目的昵称是“ Storm ”,脚本如下:

version: '3.3'

services:
rabbitmq:
container_name: stormy_rabbitmq
image: rabbitmq:management-alpine
restart: unless-stopped
ports:
- 5672:5672
- 15672:15672
expose:
- 5672
volumes:
#- /appdata/stormy/rabbitmq/etc/:/etc/rabbitmq/
- /appdata/stormy/rabbitmq/data/:/var/lib/rabbitmq/
- /appdata/stormy/rabbitmq/logs/:/var/log/rabbitmq/
networks:
- default

settings:
container_name: stormy_settings
image: registry.gitlab.com/robinhoodcrypto/stormy/settings:latest
restart: unless-stopped
volumes:
- /appdata/stormy/settings:/appdata/stormy/settings
external_links:
- stormy_rabbitmq:rabbitmq
networks:
- default

capture:
container_name: stormy_capture
image: registry.gitlab.com/robinhoodcrypto/stormy/capture:latest
restart: unless-stopped
volumes:
- /appdata/stormy/capture:/appdata/stormy/capture
external_links:
- stormy_rabbitmq:rabbitmq
networks:
- default

livestream:
container_name: stormy_livestream
image: registry.gitlab.com/robinhoodcrypto/stormy/livestream:latest
restart: unless-stopped
volumes:
- /appdata/stormy/capture:/appdata/stormy/livestream
external_links:
- stormy_rabbitmq:rabbitmq
networks:
- default


networks:
default:
external:
name: stormy-network

'up' 脚本如下:
[ ! "$(docker network ls | grep stormy-network)" ] && docker network create stormy-network
echo '*****' | docker login registry.gitlab.com -u 'gitlab+deploy-token-******' --password-stdin
docker-compose down
docker-compose build --pull
docker-compose -p 'stormy' up -d

'向下'很简单:
docker-compose down

版本:

$ docker-compose -v

docker-compose version 1.24.1, build 4667896b



当我“向下”时,这是输出:

$ docker-compose down

Network stormy-network is external, skipping



我把详细的日志输出放在: https://pastebin.com/Qnw5J88V

为什么“向下”不起作用?

最佳答案

docker-compose -p选项设置 project name它包含在容器名称和标签等内容中; Compose 使用它来了解哪些容器属于哪些 Compose 服务。您需要在与容器交互的所有命令上指定它( docker-compose updownps ,...);如果您经常这样做,请设置 COMPOSE_PROJECT_NAME环境变量可能更容易。

#!/bin/sh
export COMPOSE_PROJECT_NAME=stormy
docker-compose build --pull
docker-compose down
docker-compose up -d

关于docker-compose down 不会.. "down"容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59740242/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com