3Answers
  • 10
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Docker hostname not working

docker run -d -v /srv/dockervolume/openssh-git/srv:/srv --name node-basickarl -h node-basickarl basickarl/node-basickarl

ping:

root@domain:/srv/dockervolume/haproxy/etc/haproxy# ping node-basickarl
ping: unknown host node-basickarl

It works when I ping the ipv4 address though. Why isn't hostname working?

Docker containers would need to create DNS entries in either your local DNS server or your /etc/hosts file in order to be reachable via hostname. They don't do this by default.

Depending on what you're doing, manually creating an entry for the container in your hosts file might be the simplest solution.

This post lists a couple alternative options:

https://stackoverflow.com/questions/31149501/how-to-reach-docker-containers-by-name-instead-of-ip-address

  • 0
Reply Report

Trending Tags