Docker for Developers by Chris Tankersley
Author:Chris Tankersley
Language: eng
Format: epub, mobi
Publisher: leanpub.com
Published: 2015-12-09T16:00:00+00:00
Well, that run command is a doozy. We’re going to create a container that runs in the background named app_nginx. This container will mount the volumes from app_php inside of itself, much like we did before with the data containers. We’re also going to mount a config file inside of it, which contains our configuration so we can have nginx talk to the php-fpm process that lives inside app_php. That is all pretty standard from the stuff I have gone over so far.
What is new is the --link [name]:[alias] option. This tells Docker to link the named container to the container you are creating, with the alias you specify. In this case, we are linking the app_php container with the name of phpserver. Inside the nginx container, we can use phpserver as the domain name for our PHP container!
If I grab the IP address for my app_nginx container using docker inspect, I can visit that IP and be greeted with a basic PHP info screen, like in Figure 3-1.
Figure 3-1 Linking containers together has a nice side effect in newer versions of Docker, at least since v1.9. Docker will now track the IP correctly when linked containers come up and down. For example, if you have the above nginx and PHP containers, and turn PHP on and off, PHP will more than likely get a new IP. This IP will be given to the nginx container automatically. Older versions of Docker set the IP staticly when the container was built, so if PHP was at 10.10.0.2 when nginx came up, nginx would think PHP was at that IP until the nginx container was restarted.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12571)
Hello! Python by Anthony Briggs(9916)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9779)
Dependency Injection in .NET by Mark Seemann(9340)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8298)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7076)
Microservices with Go by Alexander Shuiskov(6843)
Practical Design Patterns for Java Developers by Miroslav Wengner(6764)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6703)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6414)
Angular Projects - Third Edition by Aristeidis Bampakos(6108)
The Art of Crafting User Stories by The Art of Crafting User Stories(5638)
NetSuite for Consultants - Second Edition by Peter Ries(5570)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5375)
Kotlin in Action by Dmitry Jemerov(5063)
