docker-compose


cannot ping linked docker container service


having simple setup like this:
db:
image: mysql
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
links:
- db:db
environment:
RAILS_ENV: development
if i run:
docker-compose build && docker-compose run web ping db
i get:
Starting myapp_db_1
ping: unknown host
why?
if i run:
docker-compose run cat /etc/hosts
i see this:
Starting myapp_db_1
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2 4af9653f843a
(value 4af9653f843a changes on each run)
i am using docker-compose 1.6.2 and docker version 1.10.3 on mac os x (so virtualbox as well)
why does it happen? how can i access db container in web container by hostname?
ok i just realized that i need to run
docker-compose up
at least once before i can ping it

Related Links

Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface
Does Docker-Compose allow overwriting of ports when using extends?
Jhipster Docker-compose conflict
Build multiple images with Docker Compose?
JHipster Cassandra Docker Build
Defining project name inside docker-compose configuration
Docker-compose named mounted volume
cannot ping linked docker container service
How to do variable substitution in env_file?
How to create stack in tutum with docker-compose.yml file?
ecs-cli docker compose version
dynamic link update in docker-compose
How to start arbitrarily many identical containers with docker-compose?
How to stop docker-compose run command
Unable to run sensu check in a docker-compose context

Categories

HOME
reactjs
openacc
gap-system
ibm
cryengine
azure-resource-manager
salesforce-lightning
msbi
hibernate-mapping
ionic-native
tracking
facebook-marketing-api
filehelpers
airbnb
indri
single-page-application
opengraph
my.cnf
orgchart
concrete5
snapkit
webclient
fastadapter
gitosis
android-geofence
ansible-inventory
repeat
latency
julia-jump
azure-web-roles
google-cloud-powershell
gridgain
azure-data-catalog
qtwebkit
stream-socket-client
cancan
jcifs
aot
acceleo
nls
firebase-job-dispatcher
boost-bind
clique
periodic-processing
calc
abstract
instabug
markerspiderfier
matlab-engine
skscene
gnu-sort
traminer
joomla3.3
eaaccessory
applinks
qxorm
javadb
apache-pivot
api-eveonline
worklight-appcenter
agent-based-modeling
selenium-grid2
serializer
sendy
satisfiability
vbaccelerator
lastinsertid
surfaceview
google-oauth-java-client
myrrix
infomaker
coinbase-php
ntdll
dnsbl
openafs
webpage-screenshot
filedialog
optimistic-concurrency
log-shipping
netbeans7.0
rollover
pitch-shifting
miniport
file-storage
software-update

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App