-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add explicit (separate) "docker-swarm" and "triton" docker-compose files #9
Conversation
Since Triton does not yet support `docker network`, this is the best solution for making sure this repository can function appropriately in both environments (uses `docker network` for Swarm and `--link` for Triton). Without this, Swarm will see `--link` and co-schedule all the containers, which defeats the whole purpose of the demonstration.
restart: always | ||
env_file: _env | ||
environment: | ||
- CONTAINERBUDDY=file:///etc/containerbuddy.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason we don't just embed CONTAINERBUDDY=file:///etc/containerbuddy.json
directly in the image itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right to ask. That's what we've started doing since this one. Example: https://github.com/autopilotpattern/couchbase/blob/master/Dockerfile#L12
@tianon if this repo implemented the DNS discovery of Consul as it's demonstrated in https://github.com/autopilotpattern/jenkins and https://github.com/autopilotpattern/couchbase (and discussed in #10), how would that change this PR? Related: I just ticketed the task of adding setup and demo scripts, #12 and explained it in more detail in autopilotpattern/wordpress#1 (comment) |
@@ -1,35 +1,39 @@ | |||
# MySQL designed for container-native deployment on Joyent's Triton platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd eliminate the common-compose.yml
entirely. We dropped it in our more recent blueprints because eliminating the use of --link
for Consul meant that the main docker-compose.yml
could be the common parent. https://github.com/autopilotpattern/couchbase is a good example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I've started work on fixing up this repo in #14
I think some of the Triton vs Swarm issues might make more sense in the context of a diff between the two: diff --git a/docker-swarm/docker-compose.yml b/triton/docker-compose.yml
index d282c07..89130e7 100644
--- a/docker-swarm/docker-compose.yml
+++ b/triton/docker-compose.yml
@@ -6,8 +6,12 @@ services:
extends:
file: ../common-compose.yml
service: mysql
+ network_mode: bridge
+ links:
+ - consul:consul
consul:
extends:
file: ../common-compose.yml
service: consul
+ network_mode: bridge The addition of Even with that other approach, I don't see a simple way to get back to a single |
(If you'd rather, I'm happy to move the discussion of |
Just verified -- with a version 1 |
We've got good news on that coming. So, it'll be two files for now, but one in the future. At the same time, we're also looking at moving the local development to Swarm environments to make it easier to test multi-host environments on our laptops. My biggest concern isn't really about this PR, but with how much we've learned about other things that I'd want to implement here before we enshrine the historical practice. Thanks for your patience and insight as we try to work through both problems at once. |
Say more about what you're expecting that isn't covered by https://www.joyent.com/blog/introducing-triton-container-name-service? Is it just that the search domain isn't automatically set? |
FYI, I've started work on fixing up this repo in #14 |
That's the one! 😄 👍 Happy to have helped spur so much interesting discussion. 😄 |
Regarding Triton support for Docker Compose file format v2 and Docker network syntax, I should share the following tickets:
|
Re: DOCKER-585, I can't seem to find a $ docker run -dit --name test --net-alias a --net-alias b --net-alias c --net some-network debian:sid
...
$ docker inspect test
...
"Networks": {
"some-network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"a",
"b",
"c"
],
"NetworkID": "e76b7deb5c688dcf4829acc02ffff84bdbde9e3ba2fe98b3dc1068c7fb1e98a7",
"EndpointID": "6592a9634170458ac9ce98b23f0db8c01dba016281bf9bf1707fd408a4b41705",
"Gateway": "172.19.0.1",
"IPAddress": "172.19.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:13:00:03"
}
}
... (but worth pointing out that the aliases are network-specific) |
(is there any way I could subscribe to these bugs without doing something hacky like page2rss?) |
Right. That was from an earlier, proposed Docker syntax back in 2015. I need to add a note there about
That's my goal, but I'm not aware of a better plan today. |
Rock on, thanks! 👍 🤘 |
Since Triton does not yet support
docker network
, this is the best solution for making sure this repository can function appropriately in both environments (usesdocker network
for Swarm and--link
for Triton).Without this, Swarm will see
--link
and co-schedule all the containers, which defeats the whole purpose of the demonstration.