skip to Main Content

i wanted to run this java app through docker:
https://github.com/ByteHamster/PSE

the docker-compose.yml file looks like:

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

when i run docker-compose build i get this error message:
(root) Additional property monitor is not allowed

what is the valid yml to make this program run?

thanks guys

2

Answers


  1. Chosen as BEST ANSWER
    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
    
    

    had to make the following changes so make it work

    thanks @David Maze


  2. I’m sharing with other peoples who can have a similar problem.
    Check the spaces before names.

    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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search