Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

Docker - how to link an API to a web application

I am working through the dockersamples/k8s-wordsmith example.

I'm trying to do it manually first so I understand how everything interacts.

I can get all the containers to run and can see the webpage from my browser. Randomly generated sentences should appear with each refres but no words appear so clearly I haven't connected the API to the web application.

These 2 commands seem to be working:

docker run -d --name=db -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres postgres:9.4   
docker run -d --name=web -p 8080:80 dockersamples/k8s-wordsmith-web

I'm reading that --link is a legacy feature. What should I put after the second --link or is there a better way of approaching this?

docker run -d --name=words -p 5002:8080 --link db:db --link dockersamples/k8s-wordsmith-api

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...