grim/docker-noop

Get smaller

2016-05-02, Gary Kramlich
f538df99605b
Get smaller
This is a simple docker container that just runs exits successfully.
I use it with my docker-compose.override.yml files to not waste a bunch of
resources when using a shared service during development.
For example, say I have the following docker-compose.yml file:
redis:
image: redis:2.8
app:
build: .
links:
- redis:redis
When I'm running this locally, I typically have a separate redis running that's
being used by multiple other apps. So I'll add a docker-compose.override.yml
like the following
redis:
image: rwgrim/docker-noop
app:
links: []
external_links:
- redis:redis
What this does is remove all the existing links and then uses external_links to
link to my already running redis container. However, since there is no way to
disable a service with docker-compose, we override the redis in the
docker-compose.yml to use the noop container which is tiny and exits
immediately instead of sitting around wasting resources which can't be used by
anything else.