docker-compose use extra_hosts with container id -
i have dockerized app needs talk external (not dockerized) oracle database.
the app works on local machine if append result of hostname
command localhost
entry in /etc/hosts
file. otherwise error oracledb driver:
caused by: oracle.net.ns.netexception: listener refused connection following error: ora-12514, tns:listener not know of service requested in connect descriptor
i log in container , edit /etc/hosts
manually, avoid manual step after rebuilding. how keep file date?
furthermore seems hostname
set docker container id.
is there way reference container id inside docker-compose.yml
file?
maybe way set specific hostname container?
set hostname: foo
in docker-compose file , use hostname foo instead hosname based on docker id.
Comments
Post a Comment