I have installed xdg-utils in my docker container using apt-get install xdg-utils
I want the command xdg-open 'http://www.freedesktop.org/'
to open the specified url into the host browser.
right now it throws this error :
root@pravin:/# xdg-open 'http://www.freedesktop.org/'
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'http://www.freedesktop.org/'
How do I get docker to use the browser of the host os?
Open https://localhost:5800 and access the firefox over the browser. Click on “Dashboard” to see what percentage of resources this Docker container is consuming: Click on the console sign just near to the stats to open browser.
Accessing the Host With the Default Bridge Mode You just need to reference it by its Docker network IP, instead of localhost or 127.0. 0.1 . Your host's Docker IP will be shown on the inet line. Connect to this IP address from within your containers to successfully access the services running on your host.
It depends on your host, but look for /etc/default/docker or /var/lib/boot2docker/profile (for Docker Machine hosts using a boot2docker VM). Then get the IP address of the machine hosting your Docker daemon. (With a Docker Machine created host, that would be: docker-machine ip <yourmachine> .)
You can't, because container doesn't share with OS process/network namespace/filesystems by default.
In theory you can start container in the host process namespaces (--pid=host
), network host namespace (--network=host
) and mount required FS to the container (--volume ..
), but still you may have another issues. That will require very advance Docker container skills.
I think it may be hard to attach to host process and open new window.
There can be some solution that will overcome this difficulties. You can run browser process inside container and share display with host.
The main idea is to share DISPLAY
environmental variable and network between host and container. More about this you can find in this great article .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With