Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent docker forces usage of new Docker Compose V2 #3075

Closed
andileco opened this issue Jul 9, 2021 · 12 comments
Closed

Recent docker forces usage of new Docker Compose V2 #3075

andileco opened this issue Jul 9, 2021 · 12 comments
Assignees
Labels
high priority Things that should be addressed ASAP
Projects

Comments

@andileco
Copy link

andileco commented Jul 9, 2021

Recently got a new work computer and found out it had an M1 chip. I can't get Lando working and get errors related to "services":

"lando rebuild -y" (or destroy) gives me:

services.appserver_nginx.env_file must be a string

"lando start" gives me:

services.ca.ports must be a list

"lando info" gives me:

[ { service: 'appserver_nginx',
urls: [],
type: 'nginx',
healthy: true,
managed: true,
webroot: 'web',
config:
{ vhosts: '/Users/me/.lando/config/pantheon/drupal8.conf.tpl',
php: '/Users/me/.lando/config/pantheon/php.ini',
server: '/Users/me/.lando/config/pantheon/nginx.conf.tpl' },
version: '1.16',
meUser: 'www-data',
hasCerts: true,
hostnames: [ 'appserver_nginx.mysite.internal' ] },
{ service: 'appserver',
urls: [],
type: 'php',
healthy: true,
via: 'nginx:1.16',
served_by: 'appserver_nginx',
webroot: 'web',
config:
{ php: '/Users/me/.lando/config/pantheon/php.ini',
server: '/Users/me/.lando/config/pantheon/nginx.conf.tpl',
vhosts: '/Users/me/.lando/config/pantheon/drupal8.conf.tpl' },
version: '7.4',
meUser: 'www-data',
hasCerts: false,
hostnames: [ 'appserver.mysite.internal' ] },
{ service: 'database',
urls: [],
type: 'mysql',
healthy: true,
internal_connection: { host: 'database', port: '3306' },
external_connection: { host: '127.0.0.1', port: true },
healthcheck: 'bash -c "[ -f /bitnami/mysql/.mysql_initialized ]"',
creds: { database: 'pantheon', password: 'pantheon', user: 'pantheon' },
config: { database: '/Users/me/.lando/config/pantheon/mysql.cnf' },
version: '5.7',
meUser: 'www-data',
hasCerts: false,
hostnames: [ 'database.mysite.internal' ] } ]

.lando.yml file:

name: my-site
recipe: pantheon
config:
framework: drupal8
site: my-site
id: [redacted]
'#' Disable the SOLR index
index: false
'#' Disable the VARNISH edge
edge: false
'#' Disable the REDIS cache
cache: false
services:
appserver:
scanner: false
database:
type: mysql
portforward: true
creds:
user: pantheon
password: pantheon
database: pantheon
healthcheck: null

@yobottehg
Copy link
Sponsor

I also get this errors without an M1 chip. Perhaps some fresh released containers?

@andileco
Copy link
Author

@pirog told me how to address this: go to Preferences in Docker Desktop, click the "Experimental Features" horizontal tab, uncheck "Use Docker Compose V2", and then click "Apply & Restart". Then, run "lando rebuild -y" or whatever you were planning to run.

@pirog pirog self-assigned this Aug 23, 2021
@pirog pirog changed the title Various services errors on Lando v3.1.4 and Docker 35.1 (on OS Big Sur 11.4 with M1 chip) Recent docker forces usage of new Docker Compose V2 Aug 23, 2021
@pirog pirog added the high priority Things that should be addressed ASAP label Aug 23, 2021
@pirog
Copy link
Sponsor Member

pirog commented Aug 23, 2021

Next version of Lando will force usage of the older docker-compose until we officially support the newer one. This will happen regardless of whether you've checked the box in Docker Desktop or not.

@pirog pirog added this to Needs triage in Lando via automation Aug 23, 2021
@Tbaile
Copy link

Tbaile commented Sep 29, 2021

In the Arch Linux community repository, docker-compose has been officially updated to 2.0.0.
There's anything to be done to implement support for the new version of compose? The docs that define the compatibility between the two versions suggests that the changes are very little and none of them should be gamebreaking for lando.

@pirog
Copy link
Sponsor Member

pirog commented Sep 29, 2021

We will support 2.x at some point

@Tbaile
Copy link

Tbaile commented Sep 30, 2021

I've browsed the code a little, found out that the only changes actually needed for it to work is to change (based on the docker-compose version detected) how compose commands are built. If the implementation is somewhat clean I'll send this through a PR.

@pirog
Copy link
Sponsor Member

pirog commented Sep 30, 2021 via email

@Tbaile
Copy link

Tbaile commented Sep 30, 2021

Absolutely, the V2 is currently a release candidate and not ready for production as documentation states, I've tried with a bunch of projects locally and everything works, I've surely not tested every use of application of this new version.
Lando could show a warning for a "beta release" of compose and just work by changing, based on the version of compose detected, how compose.js generates the commands. Then we'll have what we need to change in order for lando to support the newer version before this drops on any major platform.

@Tbaile
Copy link

Tbaile commented Oct 8, 2021

Quick update on this.
As of v2.0.1 docker-compose automatically sends the commands to the new compose plugin. It's currently working perfectly fine on lando v3.4.2 with no issues whatsoever.

@reynoldsalec
Copy link
Sponsor Member

@Tbaile does that mean that most users could be running Docker Compose V2 and won't experience any issues without any changes to Lando?

Hoping we can close this out... :)

@reynoldsalec reynoldsalec self-assigned this Nov 22, 2021
@Tbaile
Copy link

Tbaile commented Nov 24, 2021

Yes, the issue can be closed.
I don't think there's the need to run a check within Lando since very few people will encounter this issue.

TLDR:
If the docker-compose version you run is exactly the 2.0.0, you wont be able to run Lando at all. You need the version 2.0.1 or above that integrates the "conversion" script from the previous commands to the new plugin.

@reynoldsalec
Copy link
Sponsor Member

Awesome, thanks @Tbaile, closing this out.

Lando automation moved this from Needs triage to Closed Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority Things that should be addressed ASAP
Projects
Lando
Closed
Development

No branches or pull requests

5 participants