Score:-1

Incorrect IP address of docker container

ga flag

I use RockyLinux and I have installed Docker for my services. My docker-compose.yml file looks similar like this:

version: "3.9"
 
services:
  service_a:
    container_name: service_a
    build: ./images/service_a
    hostname: service_a
    restart: always    
    environment:
      TZ: 'Europe/Warsaw'
    networks:
      default_network:
        ipv4_address: 172.16.238.20
        aliases:
          - service_a.lan
  
  service_b:
    container_name: 'service_b'
    build: ./images/service_b
    hostname: service_b
    restart: always      
    environment:
      TZ: 'Europe/Warsaw'      
    networks:
      default_network:
        ipv4_address: 172.16.238.21
        aliases:
          - service_b.lan
      
networks:
  default_network:
    driver: bridge    
    ipam:
      driver: default
      config:
        - subnet: 172.16.238.0/24

I have tried to communicate between the above services (let's assume that I connected from service_b to service_a). When I was analysing network trafic on one of container (let's asume that it is service_a) I noticed that all incomming traffic has incorrect ip address (172.16.238.1 instead of 172.16.238.21). I would like to get IP of service_b (172.16.238.21). What can I do to achieve this goal?

Score:0
ga flag

Problem solved. The system has been restarted and it works.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.