craftcms / spoke-and-chain

Craft CMS + Craft Commerce demo site.
https://craftcms.com/demo?kind=spokeandchain
BSD Zero Clause License
53 stars 28 forks source link

unable to create the container, no such image mysql:8 #22

Closed olets closed 3 years ago

olets commented 3 years ago

Description

Setup step 2 says to create a new MySQL 8 database. That errors for me.

Steps to reproduce

% nitro db new 
Which database engine should we use
  1. mariadb
  2. mysql
  3. postgres
Enter your selection: 2
Which version should we use? 8
Which port should we use for mysql [3307]? 
Apply changes now [Y/n]? 
Checking network…
  ✓ network ready
Checking proxy…
  ✓ proxy ready
Checking databases…
  … checking mariadb-10.5-3306.database.nitro ✓
  … checking postgres-13-5433.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5434.database.nitro ✓
  … checking mysql-8-3307.database.nitro   … downloading mysql:8 ✗
Error: unable to create the container, Error response from daemon: No such image: mysql:8

Same if I specify 8.0

% nitro db new 
Which database engine should we use
  1. mariadb
  2. mysql
  3. postgres
Enter your selection: 2
Which version should we use? 8.0
Which port should we use for mysql [3307]? 
Apply changes now [Y/n]? 
Checking network…
  ✓ network ready
Checking proxy…
  ✓ proxy ready
Checking databases…
  … checking mariadb-10.5-3306.database.nitro ✓
  … checking postgres-13-5433.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5434.database.nitro ✓
  … checking mysql-8-3307.database.nitro   … downloading mysql:8 ✗
Error: unable to create the container, Error response from daemon: No such image: mysql:8

Additional info

(Maybe these data points aren't applicable to issues in this repo, since they should be controlled?)

mattstein commented 3 years ago

Hey @olets, are you on an M1 Mac? Nitro doesn’t support MySQL specifically for ARM, but you should be able to get away with MariaDB instead.

olets commented 3 years ago

Yes I am. Got it, this is https://github.com/craftcms/nitro/issues/296 — I'd forgotten about that.

Do you recommend a specific MariaDB version?

Looks like I've tangled Nitro up somehow. It's still trying to use MySQL. Is this an expected behavior I need to know how to work around, or should I open a new Nitro ticket?:

% nitro db new
Which database engine should we use
  1. mariadb
  2. mysql
  3. postgres
Enter your selection: 1
Which version should we use? 10.6
Which port should we use for mariadb [3307]?
Apply changes now [Y/n]?
Checking network…
  ✓ network ready
Checking proxy…
  ✓ proxy ready
Checking databases…
  … checking mariadb-10.5-3306.database.nitro ✓
  … checking postgres-13-5433.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5432.database.nitro ✓
  … checking postgres-13-5434.database.nitro ✓
  … checking mysql-8-3307.database.nitro   … downloading mysql:8 ✗
Error: unable to create the container, Error response from daemon: No such image: mysql:8
mattstein commented 3 years ago

Do you recommend a specific MariaDB version?

I do not; I’ve been using latest (10 / 10.6).

IIRC you may need to delete the MySQL reference from .nitro/nitro.yaml so Nitro stops trying (and failing) to install it:

… checking mysql-8-3307.database.nitro … downloading mysql:8 ✗

That looks like a Nitro bug, though.

khalwat commented 3 years ago

This Dockerized setup of the repo uses a version of MySQL 8 from Oracle that works natively on M1 machines and should just fire up for you @olets : https://github.com/nystudio107/spoke-and-chain

jasonmccallister commented 3 years ago

@olets have some follow up with might be related here.

olets commented 3 years ago

@khalwat that's great news. My team's projects are mostly on older versions, didn't realize 8 is working. I'll try yours out.

khalwat commented 3 years ago

@olets yeah if you use the image from Oracle, it works fine:

FROM mysql/mysql-server:8.0

Confusingly, the official MySQL 8 image isn't from Oracle, it's from the Docker team, and doesn't yet work properly with Apple Silicon.

jasonmccallister commented 3 years ago

Closing as this is related to https://github.com/craftcms/nitro/issues/296