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

Error response from daemon: lease moby-image-sha256:XXXXXXXXX not found #597

Closed
ssx opened this issue Jul 27, 2023 · 9 comments
Closed

Error response from daemon: lease moby-image-sha256:XXXXXXXXX not found #597

ssx opened this issue Jul 27, 2023 · 9 comments

Comments

@ssx
Copy link

ssx commented Jul 27, 2023

Sail Version

1.23.1

Laravel Version

10.16.1

PHP Version

8.2

Operating System

macOS

OS Version

14.0

Description

Bit of an odd one here.

When installing Sail into a blank app, I'm getting the following error when running sail up:

Error response from daemon: lease "moby-image-sha256:6936624d0c533c751ae6e6a4e7e1e82cc6e37945a3807b063d457da21c1e24d9": not found

I'm not entirely sure this is a sail issue - I think it may be a Docker/Apple SIlicon issue instead.

Is this something you folks have seen or had other reports of?

Steps To Reproduce

Install blank project, install sail, sail up.

@ssx
Copy link
Author

ssx commented Jul 27, 2023

Fairly sure this isn't a sail issue - it's to do with not having rosetta running on my M2 macbook. I'll close for now and do some further testing.

@driesvints
Copy link
Member

I'll leave this open for a bit to see if others report the same but also fairly sure this is a network, downstream issue or temp hiccup.

@ssx
Copy link
Author

ssx commented Jul 27, 2023

@driesvints I think it's a Docker 4.21 issue - got the same happening on other images as well.

@ssx
Copy link
Author

ssx commented Jul 27, 2023

..and other machines running 4.21 as well.

@driesvints
Copy link
Member

Think it's safe to say then that this isn't a Sail issue @ssx?

@ssx
Copy link
Author

ssx commented Jul 27, 2023

Yeah - I think it's some combination of newer Docker versions and Rosetta. I don't have Rosetta on my home macbook and can't get sail to run at all. I'd imagine non-arm Mac's don't have this issue at all.

Work mac, I can build and run on Docker 14.5 but not the later versions (will do some more testing).

@ssx
Copy link
Author

ssx commented Jul 27, 2023

Narrowed this down somewhat. It's definitely an Apple Silicon issue more than anything else.

By default, the problem seems to be newer versions of Docker are building linux/arm64 images when they should be linux/amd64.

If the platform is set in the FROM label of the Dockerfile, it solves this problem:

FROM --platform=linux/amd64 ubuntu:22.04

This appears to solve the problem and all the containers run as expected (even in newer Docker versions).

What I think is happening is that during the build process, it's losing the platform somewhere and then generates a parent image with the wrong platform. When they're built as default as linux/arm64 it then can't find the parent.

@ssx
Copy link
Author

ssx commented Jul 27, 2023

So, I know what this is now.

On an M1/M2 Mac - to make this work properly in newer Docker versions without modifying anything in Sail, you will need to run this first:

DOCKER_DEFAULT_PLATFORM=linux/amd64 docker pull ubuntu:22.04

If you don't do this first, what happens is Docker pulls a linux/arm64 image down for Ubuntu which will build successfully and look like it's going to work.

When you then run sail up, it fails to find one of the images it needs:

image

which I think is because some of the services are running as linux/amd64 so it assumes the app container is too. The sha256 reference in the image above is the created linux/arm64 image.

When you try to build purely as linux/arm64 it's getting a platform mismatch.

So, to solve, run:

DOCKER_DEFAULT_PLATFORM=linux/amd64 docker pull ubuntu:22.04

then carry on as usual running sail build --no-cache and sail up.

@driesvints
Copy link
Member

Glad you solved that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants