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

Cant get it running on with docker compose 3.7 on ubuntu linux #32

Closed
leozilla opened this issue Apr 17, 2020 · 4 comments
Closed

Cant get it running on with docker compose 3.7 on ubuntu linux #32

leozilla opened this issue Apr 17, 2020 · 4 comments
Assignees
Labels

Comments

@leozilla
Copy link

This is similar to #21

I followed the README but I still dont get any visible output on the terminal which listens with nc.

version: '3.7'

networks:
  backend:
    driver: bridge

services:
  host.docker.internal:
    image: qoomon/docker-host
    cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
    restart: on-failure
    networks:
      - backend

  tcp_message_emitter:
    depends_on: [ host.docker.internal ]
    image: alpine
    command: [ "sh", "-c", "while :; do date; sleep 1; done | nc 'host.docker.internal' 2323 -v"]
    networks:
      - backend
$ docker-compose -f docker-compose.yml up -d
Creating network "docker-compose_backend" with driver "bridge"
Creating docker-compose_host.docker.internal_1 ... done
Creating docker-compose_tcp_message_emitter_1  ... done
# i have more networks but I only show the relevant one
$ docker network ls
NETWORK ID          NAME                          DRIVER              SCOPE
a5aa8ca04a22        docker-compose_backend        bridge              local
$ sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' docker-compose_host.docker.internal_1
172.28.0.2
$ sudo ufw allow from 172.28.0.2 proto tcp to any port 2323
Rules updated

All of the following nc commands on the host give no output:

$ nc 127.0.0.1 2323 -lk
$ nc 0.0.0.0 2323 -lk
$ docker network inspect docker-compose_backend --format='{{( index .IPAM.Config 0).Gateway}}'
172.28.0.1
$ nc 172.28.0.1 2323 -lk

Unfortunately I didnt find the problem myself so far, maybe you have some ideas.

@qoomon qoomon self-assigned this Apr 17, 2020
@qoomon
Copy link
Owner

qoomon commented Apr 17, 2020

I recently updated the examples, I replaced the container name docker-host with host.docker.internal maybe that is causing problems. Will have a deeper look into it this weekend.

@qoomon
Copy link
Owner

qoomon commented Apr 19, 2020

It was my bad I revert my changes in the README back to docker-host, please try again.
Sorry for the inconvenience.

@qoomon qoomon closed this as completed Apr 19, 2020
@leozilla
Copy link
Author

@qoomon Thanks it works now. It seems like dashes are not supported in service/container names. Do you know why? because I havent found that this restriction is mentioned in the docker compose docs

@qoomon
Copy link
Owner

qoomon commented Apr 20, 2020

@leozilla actually it works, however it does not work with docker-compose, don't know why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants