过去几天,我一直在努力解决一个问题。具体来说,我得到的关于Clowder图片状态的不健康消息。这个事实不允许我在本地主机上运行该应用程序。这是docker ps
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d46319e43bd5 clowder/clowder:latest "/bin/sh -c /home/cl…" 3 hours ago Up 3 hours (unhealthy) 9000/tcp clowder_clowder_1
a1c4a3240a4a clowder/monitor:latest "/bin/sh -c 'python …" 3 hours ago Up 3 hours 9999/tcp clowder_monitor_1
fa4e9662b1c8 traefik:1.7 "/traefik --loglevel…" 3 hours ago Up 3 hours 0.0.0.0:8000->80/tcp, 0.0.0.0:8443->443/tcp clowder_traefik_1
a59cf98c71c7 mongo:3.6 "docker-entrypoint.s…" 3 hours ago Up 3 hours 27017/tcp clowder_mongo_1
5496405f71e7 elasticsearch:2 "/docker-entrypoint.…" 3 hours ago Up 3 hours 9200/tcp, 9300/tcp clowder_elasticsearch_1
7c2c986527d8 rabbitmq:management-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp clowder_rabbitmq_1
这是我的docker-compose.yml
文件:
version: '3.5'
services:
# ----------------------------------------------------------------------
# SINGLE ENTRYPOINT
# ----------------------------------------------------------------------
# webserver to handle all traffic. This can use let's encrypt to generate a SSL cert.
traefik:
image: traefik:1.7
command:
- --loglevel=INFO
- --api
# Entrypoints
- --defaultentrypoints=https,http
- --entryPoints=Name:http Address::80 ${TRAEFIK_HTTP_REDIRECT:-""}
- --entryPoints=Name:https Address::443 ${TRAEFIK_HTTPS_OPTIONS:-TLS}
# Configuration for acme (https://letsencrypt.org/)
- --acme=${TRAEFIK_ACME_ENABLE:-false}
#- --acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --acme.email=${TRAEFIK_ACME_EMAIL:-""}
- --acme.entrypoint=https
- --acme.onhostrule=true
- --acme.storage=/config/acme.json
- --acme.httpchallenge.entrypoint=http
- --acme.storage=/config/acme.json
- --acme.acmelogging=true
# DOCKER
- --docker=true
- --docker.endpoint=unix:///var/run/docker.sock
- --docker.exposedbydefault=false
- --docker.watch=true
restart: unless-stopped
networks:
- clowder
ports:
- "${TRAEFIK_HTTP_PORT-8000}:80"
- "${TRAEFIK_HTTPS_PORT-8443}:443"
labels:
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.port=8080"
- "traefik.frontend.rule=${TRAEFIK_HOST:-}PathPrefixStrip: /traefik"
- "traefik.website.frontend.whiteList.sourceRange=${TRAEFIK_IPFILTER:-172.16.0.0/12}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik:/config
# ----------------------------------------------------------------------
# CLOWDER APPLICATION
# ----------------------------------------------------------------------
# main clowder application
clowder:
image: clowder/clowder:${CLOWDER_VERSION:-latest}
restart: unless-stopped
networks:
- clowder
depends_on:
- mongo
environment:
- CLOWDER_ADMINS=${CLOWDER_ADMINS:-admin@example.com}
- CLOWDER_REGISTER=${CLOWDER_REGISTER:-false}
- CLOWDER_CONTEXT=${CLOWDER_CONTEXT:-/}
- CLOWDER_SSL=${CLOWDER_SSL:-false}
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
- RABBITMQ_EXCHANGE=${RABBITMQ_EXCHANGE:-clowder}
- RABBITMQ_CLOWDERURL=${RABBITMQ_CLOWDERURL:-http://clowder:9000}
- SMTP_MOCK=${SMTP_MOCK:-true}
- SMTP_SERVER=${SMTP_SERVER:-smtp}
labels:
- "traefik.enable=true"
- "traefik.backend=clowder"
- "traefik.port=9000"
- "traefik.frontend.rule=${TRAEFIK_HOST:-}PathPrefix: ${CLOWDER_CONTEXT:-/}"
volumes:
- clowder-custom:/home/clowder/custom
- clowder-data:/home/clowder/data
# ----------------------------------------------------------------------
# CLOWDER DEPENDENCIES
# ----------------------------------------------------------------------
# database to hold metadata (required)
mongo:
image: mongo:3.6
restart: unless-stopped
networks:
- clowder
volumes:
- mongo:/data/db
# message broker (optional but needed for extractors)
rabbitmq:
image: rabbitmq:management-alpine
restart: unless-stopped
networks:
- clowder
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbitmq_management path_prefix "/rabbitmq"
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER:-guest}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS:-guest}
labels:
- "traefik.enable=true"
- "traefik.backend=rabbitmq"
- "traefik.port=15672"
- "traefik.frontend.rule=${TRAEFIK_HOST:-}PathPrefix: /rabbitmq"
- "traefik.website.frontend.whiteList.sourceRange=${TRAEFIK_IPFILTER:-172.16.0.0/12}"
volumes:
- rabbitmq:/var/lib/rabbitmq
# search index (optional, needed for search and sorting future)
elasticsearch:
image: elasticsearch:2
command: elasticsearch -Des.cluster.name="clowder"
networks:
- clowder
restart: unless-stopped
environment:
- cluster.name=clowder
volumes:
- elasticsearch:/usr/share/elasticsearch/data
# monitor clowder extractors
monitor:
image: clowder/monitor:${CLOWDER_VERSION:-latest}
restart: unless-stopped
networks:
- clowder
depends_on:
- rabbitmq
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
- RABBITMQ_MGMT_PORT=15672
- RABBITMQ_MGMT_PATH=/rabbitmq
labels:
- "traefik.enable=true"
- "traefik.backend=monitor"
- "traefik.port=9999"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefixStrip:/monitor"
# ----------------------------------------------------------------------
# NETWORK FOR CONTAINER COMMUNICATION
# ----------------------------------------------------------------------
networks:
clowder:
# ----------------------------------------------------------------------
# VOLUMES FOR PERSISTENT STORAGE
# ----------------------------------------------------------------------
volumes:
traefik:
clowder-data:
clowder-custom:
mongo:
rabbitmq:
elasticsearch:
我运行docker-compose up -d
来创建应用。升级到macOS 10.15.7后,问题开始了。在那之前,我能够使事情顺利进行。抱歉,我在docker方面的经验有限。谢谢大家!
答案 0 :(得分:0)
因此解决方案是将clowder容器内的healthchech.sh
文件更改为:
#!/bin/bash
### Add trailing backslash if not in context
[[ "${CLOWDER_CONTEXT}" != */ ]] && CLOWDER_CONTEXT="${CLOWDER_CONTEXT}/"
curl -s --fail http://localhost:9000${CLOWDER_CONTEXT:-/}healthz || exit 1
问题解决了。