Show an error on 'run' when there are legacy one-off containers
(cherry picked from commit 81707ef1ad)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Fix smart recreate when 'image' is changed to something nonexistent
(cherry picked from commit 2bc10db545)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Fix bug where duplicate container is leftover after 'up' fails
(cherry picked from commit f42fd6a3ad)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Stop 'rm' and 'ps' listing services not defined in the current file
(cherry picked from commit d85688892c)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Validate that service names passed to Project.containers aren't bogus.
(cherry picked from commit bc14c473c9)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Possible division by zero error when pulling an image - fixes#1463
(cherry picked from commit d0e87929a1)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This fixes a bug where migration would fail with an error if a
downstream container was migrated before its upstream dependencies, due
to `check_for_legacy_containers()` being implicitly called when we fetch
`links`, `volumes_from` or `net` dependencies.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
When an upstream dependency (e.g. a db) has a container but a downstream
service (e.g. a web app) doesn't, a web container is not created on
`docker-compose up`.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
"Define and run multi-container applications with Docker"
Not just development environments, and "complex" is not clear and
not really true.
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
- One-off containers were included in the warning log messages, which can
make for unreadable output when there are lots (as there often are).
- Compose was attempting to recreate one-off containers as normal
containers when migrating.
Fixed by implementing the exact naming logic from before we used labels.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
- Rename `migration` module to `legacy` to make its legacy-ness explicit
- Move `check_for_legacy_containers` into `legacy` module
- Fix migration test so it can be run in isolation
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
If we're just streaming logs from `docker-compose up`, we don't need
to set AttachStdin/out/err, and doing so results in containers with
different configuration depending on whether `up` or `run` were invoked
with `-d` or not.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
We shouldn't start the container before handing it off to dockerpty -
dockerpty will start it after attaching, which is the correct order.
Otherwise the container might exit before we attach to it, which can
lead to weird bugs.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>