docker-host | docker sidecar container forward all traffic | Proxy library
kandi X-RAY | docker-host Summary
kandi X-RAY | docker-host Summary
A docker sidecar container to forward all traffic to local docker host or any other host
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of docker-host
docker-host Key Features
docker-host Examples and Code Snippets
Community Discussions
Trending Discussions on docker-host
QUESTION
I'm using docker-desktop
(version: Docker version 20.10.12, build e91ed57
) on macOS
My problem: Can not connect and push image to the nexus registry container
Here is my steps & errors:
Pull & Start nexus container
docker volume create --name nexus-data
docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-dasonatype/nexus3:3.37.3
Connect to the
0.0.0.0:8081
Then i connect to the 0.0.0.0:8081
and create a docker-hosted
repository and in HTTP
section i add the 8083
port.
then i create a user (ali
) and assigned to it a password and a role
- add
insecure-registries
to the docker engine
then according to this documentation i added this line to the docker engine
:
ANSWER
Answered 2022-Feb-10 at 12:38To access a port in the container from the host, it needs to be published. So the run command should be
QUESTION
I was able to build a multiarch image successfully from an M1 Macbook which is arm64. Here's my docker file and trying to run from a raspberrypi aarch64/arm64 and I am getting this error when running the image: standard_init_linux.go:228: exec user process caused: exec format error
Editing the post with the python file as well:
...ANSWER
Answered 2021-Oct-27 at 16:58A "multiarch" Python interpreter built on MacOS is intended to target MacOS-on-Intel and MacOS-on-Apple's-arm64.
There is absolutely no binary compatibility with Linux-on-Apple's-arm64, or with Linux-on-aarch64. You can't run MacOS executables on Linux, no matter if the architecture matches or not.
QUESTION
I need to restrict connections to a docker container. The docker documentation states the following:
...ANSWER
Answered 2021-Oct-14 at 08:31Found a solution here.
The interface should be specified in the DROP
line.
QUESTION
I'm running Kafka in docker and I've a .NET application that I want to use to consume messages. I've followed following tutorials with no luck:
https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
Connect to Kafka running in Docker
Interact with kafka docker container from outside of docker host
On my consumer application I get the following error if I try to conenct directly to containers ip:
ANSWER
Answered 2021-May-10 at 14:13If you are running your consuming .NET app outside of Docker, you should try to connect to localhost:9092
. The kafka
hostname is only valid in Docker.
You'll find an example of how to run Kafka in Docker and consume the messages from it using a .NET Core app here.
You could compare the docker-compose.yml from that example with yours.
Here is how the the .NET Core app sets up the consumer:
QUESTION
I'm using WSL2 on Windows 10 19042. Here is my setup which works well with others applications like netcat
, npx http-server
or python -m SimpleHTTPServer
.
Tested on Java 8 and 11. The following screenshots have been taken from this version.
...ANSWER
Answered 2021-Apr-04 at 14:50It's the author post again and I realized how to solve. The java application runs on IPv6 by default and it should be run on IPv4. So you just need to run the application with:
QUESTION
I'm using https to protect the docker daemon socket. Followed all the steps as mentioned here. The environment variables are set as below,
- DOCKER_TLS_VERIFY=1
- DOCKER_CERT_PATH=~/.docker == All my client, ca & server certificates + keys exist here
- DOCKER_HOST=tcp://$HOST:2376
The below command works (when I pass ca, client certificate & key):
...ANSWER
Answered 2021-Apr-01 at 17:22I found the answer myself ! The client certificate and key generated are having the names as cert.pem and key.pem when I followed the official documentation instructions. I renamed the cert.pem to client-cert.pem and key to client-key.pem in my ~/.docker directory.
Apparently, docker picks the client certificate by default, only if it has name as cert.pem and key.pem. So, my issue here is because of changing the client certificate / key names.
QUESTION
I have an application, that consists of few docker containers: nginx, client, admin, backend and mongo.
In container "backend" is running NestJS application on port 5000. Container has exposed port 5000. But container is not responding to any requests and application inside of container doesn't receive them. I've even tried to expose port 5000 to my local machine so I could make request outside of docker-host but this way container doesn't respond as well. When I'm running this NestJS app locally on my machine everything works perfectly. I have nginx.conf to configure behavior nginx container. It should redirect certain requests to specific containers using proxy. This approach works fine for client and admin containers. Both hosting NextJS application and listening on specific port. I've used the same approach for "backend" container but even though nginx seems to make correct requests, it doesn't receive response or for some reason it makes requests to wrong address inside of docker-host
Dockerfile for my custom images:
...ANSWER
Answered 2021-Feb-09 at 12:25To avoid the answer gets lost in the comments: The setup with Docker networks and linking looks correct, so this seemed to be an issue with the process itself.
In the startup of the nest.js process, it is important to bind to a different interface than localhost
or 127.0.0.1
because Docker creates virtual network interfaces and talks to the process using those. So even if localhost
works when running on the host machine directly, this won't work for Docker networking. This port would only be accessible from inside the container.
So, instead of
QUESTION
I downloaded a docker image for cadquery and jupyter notebook.
When i run the container, it gave me this message:
...ANSWER
Answered 2021-Feb-22 at 20:39The address 58bb309866f3:8888
is an internal container address in that cannot be reached from the host
You should connect using localhost and the port mapped in your docker run command. In this case you can connect using localhost:8888
QUESTION
I have a Django REST service and another Flask service that work as a broker for the application. Both are different projects that run with their own Docker container. I'm able to POST a product on the Django service that is consumed by the Flask service, however, I cannot reach the Django service via Flask. These containers are running on the same network, and I already tried Thomasleveil's suggestions, including docker-host by qoomon. The error received by the request is the same as before I tried to forward the traffic. The difference is that now when I do the request it keeps hanging for a while until it fails.
The error is as follows:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='172.17.0.1', port=8000): Max retries exceeded with url: /api/user (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out'))
The request I'm trying to make is a POST at /api/products/1/like. At the moment, no body is required.
Here is how I'm doing the POST with Flask, where the IP is the Docker IP:
...ANSWER
Answered 2021-Jan-11 at 19:54These containers are not actually on the same network. To put two containers from different docker-compose
projects into one network you need to 'import' an existing network in one of the files. Here's how you can do it:
QUESTION
On my Pi I followed this tutorial to install docker on raspbian. Few side notes here:
- I did NOT setup a swarm, I stopped at docker info and (as in other guides) I succesfully ran the hello world container.
- idk if it matters, but this guide (unlike others) had me edit
/etc/apt/sources.list
and add line:deb https://download.docker.com/linux/raspbian/ stretch stable
On my develop machine (win 10) I used this tutorial to add docker configs and ymls to my mern stack app. However at multiple points in this tutorial they wanted me to run docker commands, so I ended up having to install Docker Desktop.
But I don't want to use local containers, I want to use the remote one on my Pi. So I used this tutorial to try and setup my remote docker.
However Im getting an error:
C:\Users\oweng>docker-machine create --driver generic --generic-ip-address=192.168.1.2 --generic-ssh-key "%HOMEPATH%/.ssh/id_rsa" --generic-ssh-user=pi remote-docker-host Running pre-create checks... Creating machine... (remote-docker-host) Importing SSH key... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Enter passphrase for key 'C:\Users\oweng.docker\machine\machines\remote-docker-host\id_rsa': Enter passphrase for key 'C:\Users\oweng.docker\machine\machines\remote-docker-host\id_rsa': Detecting the provisioner... Enter passphrase for key 'C:\Users\oweng.docker\machine\machines\remote-docker-host\id_rsa': Error creating machine: Error detecting OS: OS type not recognized
I have googled the error a bit but havnt found a solution.
furthermore when checking listening ports on my Pi (docker server) I dont see it running
pi@raspberrypi:~ $ sudo lsof -i -P -n | grep LISTEN xrdp-sesm 390 root 7u IPv6 14566 0t0 TCP [::1]:3350 (LISTEN) sshd
404 root 3u IPv4 17224 0t0 TCP *:22 (LISTEN) sshd
404 root 4u IPv6 17226 0t0 TCP *:22 (LISTEN) xrdp
406 xrdp 11u IPv6 17302 0t0 TCP *:3389 (LISTEN)
So I feel like maybe the server is not running? But it seems to be.
pi@raspberrypi:~ $ systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2020-11-03 07:18:21 PST; 3h 35min ago Docs: https://docs.docker.com Main PID: 496 (dockerd) Tasks: 13 CGroup: /system.slice/docker.service └─496 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Nov 03 07:18:14 raspberrypi dockerd[496]: time="2020-11-03T07:18:14.064113743-08:00" level=warning msg="Your kernel does not support cgroup blkio throttle.w Nov 03 07:18:14 raspberrypi dockerd[496]: time="2020-11-03T07:18:14.064249212-08:00" level=warning msg="Your kernel does not support cgroup blkio throttle.r Nov 03 07:18:14 raspberrypi dockerd[496]: time="2020-11-03T07:18:14.064373483-08:00" level=warning msg="Your kernel does not support cgroup blkio throttle.w Nov 03 07:18:14 raspberrypi dockerd[496]: time="2020-11-03T07:18:14.066367493-08:00" level=info msg="Loading containers: start." Nov 03 07:18:17 raspberrypi dockerd[496]: time="2020-11-03T07:18:17.612685200-08:00" level=info msg="Default bridge (docker0) is assigned with an IP address Nov 03 07:18:18 raspberrypi dockerd[496]: time="2020-11-03T07:18:18.710629367-08:00" level=info msg="Loading containers: done." Nov 03 07:18:20 raspberrypi dockerd[496]: time="2020-11-03T07:18:20.815943637-08:00" level=info msg="Docker daemon" commit=4484c46 graphdriver(s)=overlay2 v Nov 03 07:18:20 raspberrypi dockerd[496]: time="2020-11-03T07:18:20.822947178-08:00" level=info msg="Daemon has completed initialization" Nov 03 07:18:21 raspberrypi systemd1: Started Docker Application Container Engine. Nov 03 07:18:21 raspberrypi dockerd[496]: time="2020-11-03T07:18:21.273201136-08:00" level=info msg="API listen on /var/run/docker.sock"
Update 1
following this SO post i was able to get the server running it seems. Editing docker.service file. I now get a different error when trying to create
C:\Users\oweng>docker-machine create --driver generic --generic-ip-address=192.168.1.2:2137 --generic-ssh-key "%HOMEPATH%/.ssh/id_rsa" --generic-ssh-user=pi remote-docker-host Running pre-create checks... Creating machine... (remote-docker-host) Importing SSH key... Waiting for machine to be running, this may take a few minutes... Error creating machine: Error waiting for machine to be running: Maximum number of retries (60) exceeded
Update 2 BMitch's comment lead me to these two tutorial which seem to be exactly what im trying todo https://code.visualstudio.com/docs/containers/ssh https://code.visualstudio.com/docs/containers/choosing-dev-environment#_remote-machine
...ANSWER
Answered 2020-Nov-04 at 22:21I wouldn't use docker-machine
for that. Support for the tool seems to be going away, and there are much easier methods.
The easiest is to set DOCKER_HOST
on your machine to be the ssh setting of the remote node:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install docker-host
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page