Daniel Nephin
3d9e3d0877
Remove service.start_container()
...
It has been an unnecessary wrapper around container.start() for a little while now, so we can call it directly.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-03 10:17:09 -05:00
Daniel Nephin
491d052088
Don't set a default network driver, let the server decide.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-30 11:53:36 -04:00
Daniel Nephin
c439e056a0
Merge pull request #2288 from dnephin/warning_about_vars
...
Add console color to warnings and errors so they are more obvious
2015-10-30 10:58:00 -04:00
Daniel Nephin
04a76dc284
Merge pull request #2287 from shin-/2284-ensure-network-exists-run
...
Ensure network exists when calling run before up
2015-10-30 10:41:55 -04:00
Daniel Nephin
841ed4ed21
Remove the duplicate 'Warning' prefix now that the logger adds the prefix.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-29 14:18:28 -04:00
Daniel Nephin
d836973a04
Use colors when logging warnings or errors, so they are more obvious.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-29 14:06:50 -04:00
Joffrey F
596261e759
Ensure network exists when calling run before up
...
Otherwise the daemon will error out because the network doesn't exist
yet.
Signed-off-by: Joffrey F <joffrey@docker.com>
2015-10-29 17:56:01 +01:00
Daniel Nephin
eab9d86a3d
Logs are available for all log drivers except for none.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-29 11:28:17 -04:00
Mazz Mosley
5dc14f3925
Handle non-ascii chars in volume directories
...
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-29 12:05:51 +00:00
Daniel Nephin
b6b9b002e5
Merge pull request #2254 from mnowster/1756-dont-display-output-from-previous-runs
...
1756 dont display output from previous runs
2015-10-27 18:45:47 -04:00
Mazz Mosley
76d52b1c5f
Remove redundant try/except
...
Code cleanup. We no longer need this as the api returns a 304 for any
stopped containers, which doesn't raise an error.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-27 17:12:18 +00:00
Mazz Mosley
30a84f1be6
Move rename functionality into Container
...
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-27 17:12:18 +00:00
Mazz Mosley
7603ebea9b
Attach to a container's log_stream before they're started
...
So we're not displaying output of all previous logs for a container, we attach,
if possible, to a container before the container is started.
LogPrinter checks if a container has a log_stream already attached and
print from that rather than always attempting to attach one itself.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-27 17:12:18 +00:00
Daniel Nephin
7878d38dee
Fix running one-off containers with --x-networking by disabling linking to self.
...
docker create fails if networking and links are used together.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-27 11:11:15 -04:00
mnowster
5d60fbe31e
Merge pull request #1659 from viranch/hostip-random-port
...
Allow scaling services that have port binding of the form `host_ip::container_port`
2015-10-23 17:11:28 +01:00
Daniel Nephin
ae47435425
Fix unicode in environment variables for python2.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-22 12:12:43 -04:00
Daniel Nephin
0fed5e6864
Use inspect network to query for an existing network.
...
And more tests for get_network()
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-21 13:05:14 -04:00
Daniel Nephin
b500fa2351
Refactor ServiceLoader to be immutable.
...
Mutable objects are harder to debug and harder to reason about. ServiceLoader was almost immutable. There was just a single function which set fields for a second function. Instead of mutating the object, we can pass those values as parameters to the next function.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-21 11:14:35 -04:00
Daniel Nephin
4505632274
Some minor style cleanup
...
- fixed a docstring to make it PEP257 compliant
- wrapped some long lines
- used a more specific error
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-21 11:13:00 -04:00
mnowster
fb69391889
Merge pull request #2233 from dnephin/some_unit_test_cleanup
...
Cleanup some unit tests and whitespace
2015-10-21 10:39:28 +01:00
Daniel Nephin
b1f8ed84a3
Cleanup some unit tests and whitespace.
...
Remove some unnecessary newlines.
Remove a unittest that was attempting to test behaviour that was removed a while ago, so isn't testing anything.
Updated some unit tests to use mocks instead of a custom fake.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-20 14:23:56 -04:00
Daniel Nephin
5523c3d745
Minor refactor to use guard and replace instead of split+join
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-20 12:09:01 -04:00
Daniel Nephin
3f0e083585
Force windows drives to be lowercase.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-20 11:39:06 -04:00
mnowster
5ed9f9bdf7
Merge pull request #2206 from dnephin/fix_extends_from_second_file
...
extends must be copied from override file
2015-10-20 10:22:58 +01:00
Daniel Nephin
3725c3ab7e
Merge pull request #2225 from mnowster/2221-blank-env-vars
...
2221 allow empty environment keys
2015-10-19 14:06:31 -04:00
Daniel Nephin
938d49cbdc
Fixes #2205 - extends must be copied from override file.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-19 13:41:58 -04:00
Daniel Nephin
937e087c6c
Fixes #2203 - properly validate files when multiple files are used.
...
Remove the single-use decorators so the functionality can be used directly as a function.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-19 12:39:45 -04:00
Mazz Mosley
08add665e9
Environment keys can contain empty values
...
Environment keys that contain no value, get populated with values taken
from the environment not from the build phase but from running the command `up`.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-19 16:32:12 +01:00
Mazz Mosley
ff83c459d0
Improve error message for type constraints
...
It was missing a space between the different types, when there
were 3 possible type values.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-19 14:36:56 +01:00
Viranch Mehta
258c8bc54d
Fix specifies_host_port() to handle port binding with host IP but no host port
...
Signed-off-by: Viranch Mehta <viranch.mehta@gmail.com>
2015-10-18 00:40:51 +05:30
Daniel Nephin
26dc0b785b
Give the user a better error message (without a stack trace) when there is a yaml error.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-16 15:05:06 -04:00
Cameron Eagans
53fc6d06f6
docker-compose pull SERVICE should not pull SERVICE's dependencies
...
Signed-off-by: Cameron Eagans <me@cweagans.net>
2015-10-15 17:33:32 -06:00
Daniel Nephin
0409b287ad
Merge pull request #2191 from dnephin/networking
...
Networking
2015-10-14 12:31:26 -04:00
mnowster
6b68a84b9b
Merge pull request #2019 from mrfuxi/less-verbose-extends
...
Allow to extend service using shorthand notation. Closes #1989
2015-10-14 17:13:09 +01:00
Daniel Nephin
e2f792c4f4
If -x-networking is used, set the correct API version.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-14 12:09:50 -04:00
Aanand Prasad
d5f5eb1924
Enable use of Docker networking with the --x-networking flag
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-10-14 11:19:43 -04:00
Daniel Nephin
b9c76dfabd
Merge pull request #2181 from mnowster/2128-split-drive-not-handling-relative-paths
...
2128 split drive not handling relative paths
2015-10-14 11:04:42 -04:00
Mohit Soni
f4efa29377
Added support for cgroup_parent
...
This change adds cgroup-parent support to compose project. It allows
each service to specify a 'cgroup_parent' option.
Signed-off-by: Mohit Soni <mosoni@paypal.com>
2015-10-14 15:02:42 +01:00
Karol Duleba
c7ffbf97c8
Extend oneOf error handling. Issue #1989
...
Signed-off-by: Karol Duleba <mr.fuxi@gmail.com>
2015-10-14 14:31:35 +01:00
Mazz Mosley
c1d5ecaafe
Workaround splitdrive limitations
...
splitdrive doesn't handle relative paths, so if volume_path contains
a relative path, we handle that differently and manually set drive to ''.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-13 17:27:25 +01:00
Mazz Mosley
bc6b3f970b
container paths don't need to be expanded
...
They should not ever be relative.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-13 17:03:09 +01:00
Mazz Mosley
8efc39e616
Improve boolean warning message.
...
Including examples of more boolean types, eg yes/N as it's not
always immediately clear that they are treated as booleans.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-07 14:59:08 +01:00
Aanand Prasad
627f1acdc4
Merge pull request #2126 from mnowster/1188-support-ro-options-in-volumes-from
...
1188 support ro options in volumes from
2015-10-07 11:57:14 +01:00
Mazz Mosley
f9028703f4
Pick the first container
...
Rather than inefficiently looping through all the containers that a
service has and overriding each volumes_from value, pick the first
one and return that.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-07 11:27:13 +01:00
Mazz Mosley
0ff84a78c6
Use multiple returns rather than overriding.
...
Also added a doc string for clarity.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-07 11:27:13 +01:00
Mazz Mosley
467c731869
address PR feedback
...
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-10-07 11:27:13 +01:00
Aanand Prasad
fda615008c
Merge pull request #2142 from dnephin/fix_error_cant_connect
...
Fix error when compose can't connect to docker
2015-10-07 11:22:32 +01:00
Daniel Nephin
15d0c60a73
Fix split buffer with inconsistently delimited json objects.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-06 10:43:07 -04:00
Daniel Nephin
3661e8bc74
Fix build against the swarm cluster by joining buffered output before parsing json.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-06 10:37:05 -04:00
Daniel Nephin
fe65c0258d
Remove unused attach_socket function from Container.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-06 10:37:05 -04:00