docker compose mac错误:无法启动服务zoo1:拒绝装载:

tyky79it  于 2021-06-04  发布在  Kafka
关注(0)|答案(2)|浏览(527)

运行时出现以下错误 docker-compose up -d :

% docker-compose up -d

Creating network "kafka-test_default" with the default driver
Creating kafka-test_zoo1_1 ... error

ERROR: for kafka-test_zoo1_1  Cannot start service zoo1: Mounts denied: approving /Users/test/kafka-test/zk-single-kafka-single/zoo1/datalog: file does not exist

ERROR: for zoo1  Cannot start service zoo1: Mounts denied: approving /Users/test/kafka-test/zk-single-kafka-single/zoo1/datalog: file does not exist
ERROR: Encountered errors while bringing up the project.

昨天我把docker for mac更新了好几次 Docker version 20.10.0, build 7287ab3 . macbook运行的是big sur 11.0.1。
注:docker降级至19.03.13时有效。但这不是一个好的解决办法。 docker-compose.yml 基于simplesteph/kafka的堆栈docker组装

version: '2.1'

services:
  zoo1:
    image: zookeeper:3.4.9
    hostname: zoo1
    ports:
      - "2181:2181"
    environment:
        ZOO_MY_ID: 1
        ZOO_PORT: 2181
        ZOO_SERVERS: server.1=zoo1:2888:3888
    volumes:
      - ./zk-single-kafka-single/zoo1/data:/data
      - ./zk-single-kafka-single/zoo1/datalog:/datalog

  kafka1:
    image: confluentinc/cp-kafka:5.5.1
    hostname: kafka1
    ports:
      - "9092:9092"
    environment:
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
      KAFKA_BROKER_ID: 1
      KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
    volumes:
      - ./zk-single-kafka-single/kafka1/data:/var/lib/kafka/data
    depends_on:
      - zoo1version: '2.1'

services:
  zoo1:
    image: zookeeper:3.4.9
    hostname: zoo1
    ports:
      - "2181:2181"
    environment:
        ZOO_MY_ID: 1
        ZOO_PORT: 2181
        ZOO_SERVERS: server.1=zoo1:2888:3888
    volumes:
      - ./zk-single-kafka-single/zoo1/data:/data
      - ./zk-single-kafka-single/zoo1/datalog:/datalog

  kafka1:
    image: confluentinc/cp-kafka:5.5.1
    hostname: kafka1
    ports:
      - "9092:9092"
    environment:
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
      KAFKA_BROKER_ID: 1
      KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
    volumes:
      - ./zk-single-kafka-single/kafka1/data:/var/lib/kafka/data
    depends_on:
      - zoo1
qnakjoqk

qnakjoqk1#

更新2020-12-14:
这个问题似乎在docker desktop 3.0.1 for mac中得到了解决。如果您禁用了grpc,则可能需要在更新到3.0.1后再次启用它。
上一个答案:
我在升级到docker desktop 3.0.0(mac版)后遇到了这个问题。在进入首选项并禁用实验特性->使用grpc fuse进行文件共享之后,我可以再次使用卷装载。

oxalkeyp

oxalkeyp2#

热释光;博士:如果你在docker desktop 3.0.0上,升级到3.0.1,你应该很好。
在升级到docker desktop 3.0.0 for mac之后,我也遇到了这个问题@drewsign的回答为我解决了这个问题,然后我发现下面的参考资料解释了3.0.0->中有一个bug,所以我升级到3.0.1并修复了这个问题!
github问题
docker v3.0.1发行说明
要强制docker桌面应用程序更新(在mac上),请单击顶部工具栏上的鲸鱼图标,然后单击“检查更新”。安装更新后,重新启动docker。现在您应该需要关闭“实验特性->使用grpc fuse进行文件共享”

相关问题