docker-compose


dynamic link update in docker-compose


I am using docker compose to scale the docker containers. Is there any way to create the links dynamically?
I am using --force-recreate option but I think it create a new container. I want to switch the link (HAProxy) to some other container dynamically.
Any kind of help is appreciated.
Thanks,
Sanjiv
Yes, but you need a Docker-aware load balancer that is configured to do so.
dockercloud/haproxy
Docker produces and open-sources their own HAProxy image that does support this, and does not require your to --force-recreate. It does require v2 of docker-compose.
https://github.com/docker/dockercloud-haproxy
version: '2'
services:
web:
image: dockercloud/hello-world
lb:
image: dockercloud/haproxy
links:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 80:80
Once the stack is up, you can scale the web service using docker-compose scale web=3. dockercloud/haproxy will automatically reload its configuration.

Related Links

How to work out the hostname that compose gives containers?
docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file
issues in buiding Slate with Docker
Invalid type error in Docker Compose
Django cookiecutter with Docker add pip package
Docker Compose + Swarm + Machine Networking issue
docker-compose build image parameters --force-rm --pull
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
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

Categories

HOME
joomla
typo3
wifi
azure-eventhub
mifare
jquery-plugins
squeak
hiveql
browser-cache
country-codes
core-data
mamp
solidity
pylint
simd
novacode-docx
typedef
aws-iot
quality-center
policy
android-xml
smart-device
launchd
emr
csproj
boost-log
ios-autolayout
jql
slim-lang
flickr
webmock
angularjs-resource
intersection
campaign-monitor
perf
wicket-tester
mtm
web-technologies
gradlew
html-entities
django-tables2
visualizer
reloaddata
disassembly
catalyst
qt3d
lattice
symantec
dbi
csc
jmap
innertext
ideavim
code-translation
skbio
computability
overlapping
event-tracking
persian
tess4j
esb-toolkit-2.1
mathics
alpha-beta-pruning
iphone-6
report-builder2.0
novell
formbuilder
livescript
time-frequency
cs193p
winrun4j
lettuce
windows-phone-store
thucydides
kendo-window
objectdatasource
angularjs-select2
cron4j
rfc822
netbiscuits
hypertable
filedialog
animationdrawable
helicontech
idtabs
umfpack
isgl3d
mismatch
hwnd
excellibrary
azure-appfabric
nscharacterset
pitch-shifting
versions
web-search
pkcs#7
cstring
httpbrowsercapabilities
software-update
asp.net-1.1
scalable
memory-consumption

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