docker-networking

Docker Networking Disabled: WARNING: IPv4 forwarding is disabled. Networking will not work

喜夏-厌秋 提交于 2019-12-17 21:38:57
问题 Containers in a host "suddenly" loses connection to outside-world containers. However, some hosts were refreshed and suddenly we had the following situation: The host can communicate with other hosts. Containers running in the host cannot communicate with other hosts. Here's an example: [root@pprdespap322 deploy]# ping ci.docker.company.net PING pprdespap324.corp.company.net (10.137.55.22) 56(84) bytes of data. 64 bytes from pprdespap324.corp.company.net (10.137.55.22): icmp_seq=1 ttl=64 time

docker-compose: difference between network and link

核能气质少年 提交于 2019-12-17 10:52:31
问题 I'm learning docker. I see those two terms make me confuse. For example here is a docker-compose that defined two services redis and web-app . services: redis: container_name: redis image: redis:latest ports: - "6379:6379" networks: - lognet app: container_name: web-app build: context: . dockerfile: Dockerfile ports: - "3000:3000" volumes: - ".:/webapp" links: - redis networks: - lognet networks: lognet: driver: bridge This docker-compose file defines a bridge network named lognet and all

Prometheus PostgreSQL server exporter example not working on MacOS?

故事扮演 提交于 2019-12-13 04:35:45
问题 I'd like to try out the quick start example at https://github.com/wrouesnel/postgres_exporter on a MacOS host device. In one terminal, I run a postgres image in interactive mode on the host network: > docker run --network=host -it --rm --env POSTGRES_PASSWORD=password postgres Unable to find image 'postgres:latest' locally latest: Pulling from library/postgres 8f91359f1fff: Pull complete c6115f5efcde: Pull complete 28a9c19d8188: Pull complete 2da4beb7be31: Pull complete fb9ca792da89: Pull

Can Testcontainers create docker network for me if it does not exist?

五迷三道 提交于 2019-12-12 13:37:06
问题 Looks like I need a network because I would like to reference one container by hostname from another. I could also use the --link but it is deprecated and can disappear soon. That's why I wonder if Testcontainers can create a docker network for me. With command line I would just execute docker network create bridge2 and then I can start containers like this: docker run -it --rm --net=bridge2 --name alpine1 alpine docker run -it --rm --net=bridge2 --name alpine2 alpine and resolve nslookup

How to upgrade docker container with previous network and volumes?

爱⌒轻易说出口 提交于 2019-12-12 04:47:18
问题 I'm developing an app where we pop containers with volumes and custom network. I need to add the feature where admin will be able to upgrade the running container to latest version. So I was hoping to be able to fetch the various information from it the pop a new container with the old config. Question However I'm not sure what I really need to grab on the old container and how to use it. For instance, Is NetworkSettings.Networks enough or is there network information elsewhere in the data ?

Connect docker-compose files by shared network

北城余情 提交于 2019-12-11 23:19:38
问题 I have separate docker-compose files with common configurations and application configurations. I want to connect containers defined in both docker-compose files by the common network which is defined in docker-compose.yml with the application's images. I need this to connect to the database on the container host. How can I define the same network in another docker-compose-producer file or can? My common docker-compose.yml looks like this: version: '3.3' services: kafka: image: spotify/kafka

Can docker-compose share an ip between services with discrete ports?

空扰寡人 提交于 2019-12-11 15:49:31
问题 We currently have docker containers with complex builds using supervisord so that we can group services together. For example, nginx and ssh. I'm attempting to rebuild these with more service-driven isolation linked by shared volumes. However, without mapping the IP to the host , I can't seem to find a way to allow IP addresses to be shared even though the ports may be discrete. What I'm trying to do is something like this: version: '2' services: web: image: nginx volumes: - /data/web:/var

Docker DNS settings

情到浓时终转凉″ 提交于 2019-12-11 06:38:47
问题 I try create docker container with custom network and dos settings. docker network create --driver=bridge --opt "com.docker.network.bridge.enable_ip_masquerade"="true" --opt "com.docker.network.bridge.enable_icc"="true" --opt="com.docker.network.driver.mtu"="1500" --opt="com.docker.network.bridge.host_binding_ipv4"="0.0.0.0" net -- docker run --dns 10.0.0.2 --network=net busybox cat /etc/resolv.conf nameserver 127.0.0.11 options ndots:0 Else if I use standard network all work fine docker run

How to access docker container service from outside world like from parent windows host machine

让人想犯罪 __ 提交于 2019-12-11 06:24:58
问题 As part of "How to access docker container service from outside world like from parent windows host machine " I followed the following step : 1) On windows machine(10.204.255. /16) , I created vagrant VM (172.17.0. /24) . Inside vagrant VM I created different docker images based on my requirements. 2) As part of docker image creation, created centos:6.6 images and run installed ACE-TAO service inside that. 3) TAO service is running properly, and it is binding with the specific container ip:

Slowness in Docker container

拜拜、爱过 提交于 2019-12-11 04:58:11
问题 I'm using docker for mac and curl command from docker container takes way longer than from my mac. Container is using default bridge network. See below curl command from inside the container: Command from mac: Thanks. 回答1: It is a known issue that networking with bridge / nat mode in docker is slow. You could use hosted mode. This should be solved by the macvlan driver. For further reference, please look at this bug. 回答2: This is known and solved in different ways, please see those benchmarks