Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with existing docker-compose #26

Closed
aronmgv opened this issue Nov 5, 2019 · 2 comments
Closed

How to use with existing docker-compose #26

aronmgv opened this issue Nov 5, 2019 · 2 comments

Comments

@aronmgv
Copy link

aronmgv commented Nov 5, 2019

Hi, sorry for dumb question but I dont not follow how this should be used.. If we should add dockerhost per docker-compose.yml or it should run as standalone container somewhere on the host..

I have a docker-compose file for guacamole and want to be able to access host from that container (it is a web ui to VNC machine, and want to VNC the host). What are the steps please? Imagine I freshly installed docker and docker compose and pulled docker-compose.yml file:

version: '2.0'

# networks
# create a network 'guacnetwork_compose' in mode 'bridged'
networks:
  guacnetwork_compose:
    driver: bridge

# services
services:
  # guacd
  guacd:
    container_name: guacamole.508.guacd
    image: guacamole/guacd
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - ./drive:/drive:rw
    - ./record:/record:rw
  # postgres
  postgres:
    container_name: guacamole.508.postgres
    environment:
      PGDATA: /var/lib/postgresql/data/guacamole
      POSTGRES_DB: guacamole
      POSTGRES_PASSWORD: ***********************
      POSTGRES_USER: guacamole
    image: postgres
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - ./init:/docker-entrypoint-initdb.d:ro
    - ./data:/var/lib/postgresql/data:rw

  # guacamole
  guacamole:
    container_name: guacamole.508
    depends_on:
    - guacd
    - postgres
    environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_DATABASE: guacamole
      POSTGRES_HOSTNAME: postgres
      POSTGRES_PASSWORD: ***********************
      POSTGRES_USER: guacamole
    image: guacamole/guacamole
    links:
    - guacd
    networks:
      guacnetwork_compose:
    ports:
    - 50880:8080/tcp
    restart: always

Any hints will be appreciated, thanks!

@qoomon
Copy link
Owner

qoomon commented Nov 5, 2019

Just add docker-host container to each compose file, like this
with default compose network

version: '2.0'

services:
  dockerhost:
    image: qoomon/docker-host
    cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
    mem_limit: 8M
    restart: on-failure

  # your other containers
  #   you can use `dockerhost` as dns name to access the docker host system

or
with custom compose network

version: '2.0'
networks:
  guacnetwork_compose:
    driver: bridge

services:
  dockerhost:
    image: qoomon/docker-host
    cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
    mem_limit: 8M
    nestart: on-failure
    networks:
      - guacnetwork_compose

  # your other containers
  #   you can use `dockerhost` as dns name to access the docker host system

@aronmgv
Copy link
Author

aronmgv commented Nov 5, 2019

Great it works! Thanks!

@aronmgv aronmgv closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants