docker: accessing linux-container service from windows container - docker

I need to access a service in a Linux docker container from a Windows docker container.
Setup:
Host: Windows 10 installed "Docker for Windows"
Linux Container: publish port 8080
Windows Container: access port 8080 of Linux container
Creating a shared network does not work: docker share network with windows and linux containers
Mixing Windows and Linux containers with docker-compose does not work, since platform is not supported anymore in docker-compose file: https://github.com/docker/compose/issues/5872
Am I missing something or is it not possible to access Linux container services from a windows container?

Related

How to mount USB to Linux Docker Container from Windows Host

I've set up a Docker container running Linux from my Windows Host. Now I need to use a USB2CAN Dongle in my Docker container. How do I mount the USB device to the Docker container?
Thanks in advance!

Docker container to network

I run docker container docker run -it --network host ubuntu:latest bash, but when I start there some server(on port 3000 for example), i can not open it from the main os.
How can I start the container (without describing expose or publish port) for up there some servers on different ports dynamicaly, and i want that ports will be available from the outer. I want to create container once, and keep there all changes, and back there via command docker start ..., docker exec ...
Visit this link to your solution
Here's Docker networking in the section The Host Driver
You will find the following abstract
As the name suggests, host drivers use the networking provided by the host machine. And it removes network isolation between the container and the host machine where Docker is running. For example, If you run a container that binds to port 80 and uses host networking, the container’s application is available on port 80 on the host’s IP address. You can use the host network if you don’t want to rely on Docker’s networking but instead rely on the host machine networking.
One limitation with the host driver is that it doesn’t work on Docker desktop: you need a Linux host to use it. This article focuses on Docker desktop, but I’ll show you the commands required to work with the Linux host.
The following command will start an Ubuntu image and listen to port 80 on the host machine:
docker run -it --network host ubuntu:latest /bin/bash

Passing host ip to Docker container when running docker compose file on Windows

Host ip can change, so I need to pick IP address dynamically. I've found some solutions online for dockers running for Linux, but I can't find how to do it if you run docker container on Windows. Running it through docker compose file.

connect to server runned in windows docker container

I am a newbie with docker. I need to use it at windows 7*64 , via docker toolbox. I need to make a connection to server below:
Run the server:
docker run -p 4444:4444 mycontainerWithServer
After this i open new docker toolbox window and try to connect to localhost:4444. I get ConnectionRefused error.
Because you are using the Docker toolbox you don't access your containers on localhost. The toolbox uses 192.168.99.100 by default because it is running on a Linux VM. Try replacing localhost with the VM IP.

Container to Container communication - Docker for Windows

I am a newbie to docker . I am using docker for windows on Windows 10 .
I have created a docker container application (spring boot) which need to communicate with a rabbitmq - which is again inside a container
both of them are using the same docker network(default bridge network) but when I try to connect to rabbitmq(port 5672) the connection get refused.I am using the container IP (172.17.0.2 for rabbitmq) . If I run the connecting application outside docker container and connect to a mapped rabbitmq port for my local machine it works. Deoesn't the containers connected to same docker network cannot communicate with each other using the docker ports?
First make sure, that the ports are exposed. When starting the rabbitmq container, open/map the port: -p 5672:5672.
Also, on Docker for Windows, you can query from container to container using the special DNS name host.docker.internal (see documentation: https://docs.docker.com/docker-for-windows/networking/#known-limitations-use-cases-and-workarounds).

Resources