compose: Compose unable to attach to an interactive service.

Running docker-compose up hangs with the following docker-compose.yaml:

version: '2'
services:
    sandy:
        image: ubuntu:15.10
        stdin_open: true
        tty: true

The output produced is…

Creating dockersandbox_sandy_1
Attaching to dockersandbox_sandy_1
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

The docker VM is already started and running the suggested command doesn’t fix the problem. I have also tried following the instructions detailed in the update for issue #2180 but it doesn’t appear to resolve the issue.

However, the container seems to have been created and started since it does appear in the output of docker ps. Attaching to the newly created container with docker attach {id} also appears to be working fine.

Here is the output of docker info in case the information is useful:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 1.10.1
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 4
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 4.1.17-boot2docker
Operating System: Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.956 GiB
Name: default
ID: YXX3:TYOD:BAJH:ARCD:DI6A:YI4I:JLMO:DO2L:DHIY:E7BQ:YGVZ:AAOY
Debug mode (server): true
 File Descriptors: 10
 Goroutines: 22
 System Time: 2016-02-18T05:26:52.911868214Z
 EventsListeners: 0
 Init SHA1: 
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/sda1/var/lib/docker
Labels:
 provider=virtualbox

docker -v yields Docker version 1.10.1, build 9e83765.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 21 (3 by maintainers)

Most upvoted comments

Confirmed that this is still an issue on macOS with Docker Desktop.

I’m also still experiencing this issue. As previously mentioned, the problem occurs when using docker-compose up, but everything works fine using docker-compose run name-of-service. Both stdin_open: true and tty: true are defined in the specification of the service in my docker-compose.yml file. The YAML file is version: '3', if that makes any difference.

▶ docker version
Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838
 Built:             Wed Nov 13 07:29:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:22 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 nvidia:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
▶ docker-compose version
docker-compose version 1.25.0, build 0a186604
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019