bibendi / dip

The dip is a CLI dev–tool that provides native-like interaction with a Dockerized application.
MIT License
1.26k stars 44 forks source link

Docker compose v2 compat? #138

Closed butsjoh closed 3 years ago

butsjoh commented 3 years ago

After a docker update (i am on osx) it turned on Docker compose V2 by default (see https://docs.docker.com/compose/cli-command/). After turning it off stuff started working again. Any idea if this is in the pipeline of being supported?

bibendi commented 3 years ago

What error did you get?

Adre commented 3 years ago

I seem to be having the same issue:

Actual behaviour

dip provision hangs. it gets as far as creating networks and volumes and just sits there until I ctrl+c

Expected behaviour

The command successfully builds the images ready to be run by other dip commands

Environment

Notes

Worked fine until I updated Docker Desktop - I don't know what the previous version was, but I tend to update when it tells me there's a new version - so pretty up-to-date

Disabling the Use Docker Compose V2 checkbox under Experimental Features in Docker Desktop resolved the issue for me.

butsjoh commented 3 years ago

I got the following error "Can't separate key from value". It indeed seems related to docker compose v2 (https://github.com/apache/airflow/issues/16949)

bibendi commented 3 years ago

Do you have the env file?

butsjoh commented 3 years ago

Yes we have but all of our defined env variables have a value defined. Not sure if this is a dip problem perse and it is more docker related. I am using the most recent dip version (7.1.4). Will check later today if it is indeed related to my setup.

unikitty37 commented 3 years ago

This also breaks readline in the Rails console; with Use Docker Compose V2 enabled, dip rails c gives a console where cursor keys just insert their escape sequences rather than moving the cursor, and Emacs keys like ⌃A do likewise. Disabling the setting in Docker Desktop restores the expected behaviour.

RigDillinger commented 3 years ago

According to the link given above (https://docs.docker.com/compose/cli-command/) docker-compose is turning into docker subcommand -> docker compose Hence the error:

Traceback (most recent call last):
        ...
         3: from /home/user/.rvm/gems/ruby-2.7.3/gems/dip-7.1.4/lib/dip/command.rb:30:in `exec_program'
         2: from /home/user/.rvm/gems/ruby-2.7.3/gems/dip-7.1.4/lib/dip/command.rb:48:in `run'
         1: from /home/user/.rvm/gems/ruby-2.7.3/gems/dip-7.1.4/lib/dip/command.rb:16:in `call'
/home/user/.rvm/gems/ruby-2.7.3/gems/dip-7.1.4/lib/dip/command.rb:16:in `exec': No such file or directory - docker-compose (Errno::ENOENT)

I changed docker-compose to docker compose in compose.rb:26 and the commands i ran through dip were successful. So I believe to solve the issue and to maintain compatibility, the compose version should be defined as an option in dip.yml if it is possible. Any thoughts? @bibendi

bibendi commented 3 years ago

Very good! I'll prepare DIP to the latest Compose command next week.