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

Doc update on developing environment #7417

Closed
pessimo opened this issue Aug 9, 2022 · 9 comments
Closed

Doc update on developing environment #7417

pessimo opened this issue Aug 9, 2022 · 9 comments

Comments

@pessimo
Copy link

pessimo commented Aug 9, 2022

In doc it writes

Then, you can start the backends by running docker-compose up oc10 ocis and access them via 

https://host.docker.internal:9200 (oCIS) and http://host.docker.internal:8080 (OC10). 

If you’re not using Docker Desktop, you might have to modify your /etc/hosts and 

add 172.17.0.1 docker.host.internal to make the host.docker.internal links work.

But it seems, this process only works on some Linux distributions. I also tried on windows WSL2 ubuntu, it worked.

On macOS, the system manage network in a different way, host.docker.internal is available only inside docker network which make the new ui not reachable, add docker network gateway to hosts won't solve the problem.

But luckily, developers generously provide us browser and noVNC in the docker-compose.yml file, and after you create new session on local host:4444 you’ll be able to see new design on localhost:6080.

So maybe an update on the doc is needed.

@kulmann
Copy link
Member

kulmann commented Aug 11, 2022

Hey, does https://stackoverflow.com/a/67158212 work for you to make host.docker.internal available for docker host communication?

@pessimo
Copy link
Author

pessimo commented Aug 12, 2022

Hi, thanks for the reply.

I tested 3 systems - ubuntu, windows wsl2 ubuntu, macOS Monterey. On macOS there's no docker0 network interface, so I'm pretty sure host.docker.internal as well as 172.17.0.1 won't work. Just as it says in the docker desktop docs, https://docs.docker.com/desktop/networking/#there-is-no-docker0-bridge-on-the-host.

Even if you put

version: '3.7'

services:

  fpm:
    build:
      context: .
    extra_hosts:
      - "host.docker.internal:host-gateway"

this piece of code into docker-compose.yml as suggested on this https://stackoverflow.com/a/67158212 StackOverflow thread, you can't reach the service inside docker network from your host machine outside docker network.

@kulmann
Copy link
Member

kulmann commented Aug 12, 2022

Hey, at least for macOS Monterey I can speak for myself:

  • added the line 127.0.0.1 host.docker.internal to /etc/hosts
  • nothing else needed, run yarn && yarn build:w in the web folder, then start the docker-compose stack

As far as I know both macOS and wsl2 support host.docker.internal for communicating with the host network from inside the container, but you need to add host.docker.internal as an alias for 127.0.0.1 (localhost) to /etc/hosts.

My understanding was that extra_host is only needed on linux machines.

Could you try that? Happy to adjust the docs to make them more clear. But let's first find out together what actually needs to be done. 😅

@pessimo
Copy link
Author

pessimo commented Aug 15, 2022

Hi, I tried your solution last weekend by adding 127.0.0.1 host.docker.internal to the /etc/hosts file.

I'm using oc10 as the backend, and after executing docker-compose up oc10 and yarn && yarn build:w, I can now log in to the demo page on host.docker.internal:8080 normally, but switching to the new design always redirects me to the previous page. I mean it should show me new design page if nothing went wrong.

I have no idea why...

@pascalwengerter
Copy link
Contributor

Hi, I tried your solution last weekend by adding 127.0.0.1 host.docker.internal to the /etc/hosts file.

I'm using oc10 as the backend, and after executing docker-compose up oc10 and yarn && yarn build:w, I can now log in to the demo page on host.docker.internal:8080 normally, but switching to the new design always redirects me to the previous page. I mean it should show me new design page if nothing went wrong.

I have no idea why...

Hey @pessimo, just tried out myself (after being inactive for a while in this project) and the important part is to run yarn && yarn build:w before starting docker-compose up oc10

@pascalwengerter
Copy link
Contributor

@pessimo did this resolve your issue?

@dschmidt
Copy link
Member

dschmidt commented Feb 1, 2023

Replace yarn with pnpm tho

@pascalwengerter
Copy link
Contributor

Replace yarn with pnpm tho

True, thx

@JammingBen
Copy link
Collaborator

Closing since we updated the docs in the meantime. Feel free to re-open if necessary.

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

5 participants