Skip to content

docker-compose 2.24.5 does not print all the output - could dojo work around this? #38

Closed
@xmik

Description

@xmik

This seems like a docker-compose issue that some output is lost. I'm capturing it here for troubleshooting purposes and to figure out if dojo can work around this. It happens only with newer docker-compose.

docker-compose v2.24.5

$ docker-compose version
Docker Compose version v2.24.5
$ docker --version
Docker version 25.0.2, build 29cf629


$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm -T default sh -c "whoami"  
[+] Creating 1/0
 ✔ Container testdojorunid-abc-1  Running                                                                                                                                                                     0.0s 
root
$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm -T default sh -c "echo 1234"  
[+] Creating 1/0
 ✔ Container testdojorunid-abc-1  Running                                                                                                                                                                     0.0s 

$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm  default sh -c "whoami"  
[+] Creating 1/0
 ✔ Container testdojorunid-abc-1  Running                                                                                                                                                                     0.0s 
root
k$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm default sh -c "echo 1234"  
[+] Creating 1/0
 ✔ Container testdojorunid-abc-1  Running      
$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm default sh -c "echo 1234 && whoami"  
[+] Creating 1/0
 ✔ Container testdojorunid-abc-1  Running   

So the output of whoami is visible, but the output of echo is not visible. Setting and unsetting the option -T does not change anything.

docker-compose 1.23.2

$ docker-compose version
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f  25 May 2017
$ docker --version
Docker version 20.10.12, build e91ed57

$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm -T default sh -c "whoami"
Starting testdojorunid_abc_1 ... done
root
$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm -T default sh -c "echo 1234"
Starting testdojorunid_abc_1 ... done
1234

$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm default sh -c "echo 1234"
Creating network "testdojorunid_default" with the default driver
Creating testdojorunid_abc_1 ... done
1234
$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm default sh -c "whoami"
Starting testdojorunid_abc_1 ... done
root
$ docker-compose -f ./test/test-files/itest-dc.yaml -p testdojorunid run --rm default sh -c "echo 1234 && whoami"
Starting testdojorunid_abc_1 ... done
1234
root

Both the output from whoami and echo are visible.

docker-compose file

The contents of ./test/test-files/itest-dc.yaml was:

version: '2.2'
services:
  default:
    init: true
    links:
    - abc:abc
    image: alpine:3.19
  abc:
    init: true
    image: alpine:3.19
    entrypoint: ["/bin/sh", "-c"]
    command: ["while true; do sleep 1d; done;"]

Testing also without the first line (version: '2.2') gives the same results for the new docker-compose, and it's not supported at all for the older docker-compose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions