(root)不允许附加属性监视器- Docker合成

dddzy1tm  于 2023-03-17  发布在  Docker
关注(0)|答案(2)|浏览(144)

我想通过docker运行这个java应用程序:https://github.com/ByteHamster/PSE
docker-compose.yml文件看起来像:

simulation:
  build: .
  dockerfile: simulationDockerfile
  environment:
    - DISPLAY
  expose:
    - 12868
    - 12869
    - 12870
    - 12871
  volumes:
    - /tmp/.X11-unix:/tmp/.X11-unix

monitor:
  build: .
  dockerfile: monitorDockerfile
  environment:
    - DISPLAY
  volumes:
    - /tmp/.X11-unix:/tmp/.X11-unix
  links:
    - simulation

当我运行docker-compose build我得到这个错误消息:(root)不允许附加属性监视器
什么是有效的yml使这个程序运行?
谢谢你们

a5g8bdjr

a5g8bdjr1#

version: '2'

services:
  simulation:
    build:
      context: .
      dockerfile: simulationDockerfile
    environment:
      - DISPLAY
    expose:
      - 12868
      - 12869
      - 12870
      - 12871
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix

  monitor:
    build:
      context: .
      dockerfile: monitorDockerfile
    environment:
      - DISPLAY
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    links:
      - simulation

我必须进行以下更改,以便使其正常工作
谢谢@大卫迷宫

e5nqia27

e5nqia272#

我正在与可能有类似问题的其他人共享。检查名称前的空格。

version: '2'    
services:
  simulation:
    build:
      context:
      dockerfile: simulationDockerfile
    environment:
      - DISPLAY
    expose:
      - 12868
      - 12869
      - 12870
      - 12871
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix

monitor:  <-- check the spaces before names
    build:
      context: .
      dockerfile: monitorDockerfile
    environment:
      - DISPLAY
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    links:
      - simulation

相关问题