Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

326
Vistas
Docker Compose Hostname DNS Lookup Fails

I have a simple Docker compose file as below:

version: '3'
services:
  server:
     build: ./server
     networks:
        - common
     ports:
        - "4840:4840"
     container_name: open62541_server
     hostname: open62541-server
  client:
    build: ./client
    depends_on:
       - server
    container_name: open62541_client
    networks:
        - common

networks:
    common:

When I run it, I get the following error:

Attaching to open62541_server, open62541_client
open62541_server | [2019-06-27 12:19:54.864 (UTC+0000)] info/network    TCP network layer listening on opc.tcp://open62541-server:4840/
open62541_client | [2019-06-27 12:19:55.590 (UTC+0000)] warn/network    DNS lookup of open62541-server failed with error Name or service not known
open62541_client exited with code 0

Even after specifying that the containers belong to a common network, why is that I get this error? Is there anything I'm missing?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You should use server (service name) as host to which you connect within docker-compose network instead of open62541-server as neither container_name nor hostname section in docker file affects docker-compose's internal DNS.

over 4 years ago · Santiago Trujillo Denunciar

0

You probably have a typo in the config file. hostname is open62541-server and container_name is open62541_server (with underscore). You should be able to connect to server with either the service name (i.e. server) or container_name (i.e. open62541_server)

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda