Docker for Windows - container domain name cannot be resolved -


i want set developer environment on local machine docker-compose. , i'm trying assign predefined domain names sites. must 3 level domain app1.myapps.test, instead of app1.

i want docker assign these host names automatically using 2 properties hostname , domainname, instead of assigning static ips containers , adding these ips hosts file manually.

my docker compose file is:

version: '3' services:   app1:     build: .     container_name: app-1     domainname: myapps.test     hostname: app1 

trying open http://app1.myapps.test/ , see error telling me dns address not resolved. if remove property domainname: myapps.test works fine , i'm able access site hostname http://app1/.

changing settings (without domainname)

hostname: app1.myapps.test 

or to

domainname: myapps.test hostname: app1.myapps.test 

didn't well.

is there way docker dns set multi-level domains , how option domainname works? missing something?

yes missed because of duplicate names in compose

version: '3' services:   app1:     build: .     container_name: app-1     domainname: myapps.test     hostname: app1 

if change below

version: '3' services:   app1:     build: .     container_name: app-1 

it should still work. when say

i'm able access site hostname http://app1/.

that because name of service. not because specified hostname: app1. need network aliases. , since using default network. can use below

version: '3' services:   app1:     build: .     container_name: app-1     hostname: app1     networks:       default:         aliases:           - app1.myapps.test 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -