google / android-emulator-container-scripts

1.82k stars 256 forks source link

error on emu-docker create command #280

Open shaharse opened 2 years ago

shaharse commented 2 years ago

The emu-docker create command failed with an error Failed to create container. I'm trying to run this command "emu-docker create emulator-linux_x64-7820599.zip x86_64-29_r12.zip". When I'm running this command with android 8/9 it's working well. For now I checked with Android 10 and 11 and it failed with the same error:

Step 1/15 : FROM us-docker.pkg.dev/android-emulator-268719/images/sys-29-google-x64:7603624 AS emulator ERROR:Failed to create container. Traceback (most recent call last): File "***/emu/containers/docker_container.py", line 150, in create_container image = client.images.get(identity) File "***/venv/lib/python3.6/site-packages/docker-5.0.3-py3.6.egg/docker/models/images.py", line 314, in get return self.prepare_model(self.client.api.inspect_image(name)) File "***/venv/lib/python3.6/site-packages/docker-5.0.3-py3.6.egg/docker/utils/decorators.py", line 17, in wrapped 'Resource ID was not provided' docker.errors.NullResource: Resource ID was not provided WARNING:You can manually create the container as follows: WARNING:docker build -t us-docker.pkg.dev/android-emulator-268719/images/29-google-x64-no-metrics:7820599 ***/src

When running the recommended command it through an error: manifest for us-docker.pkg.dev/android-emulator-268719/images/sys-29-google-x64:7603624 not found: manifest unknown: Failed to fetch "7603624"

NoelOmo commented 2 years ago

Any luck with this?

jodoll commented 1 year ago

I just ran into the same Issue and I guess you moved on by now, but maybe this helps someone who encounters the same problem:

The error message Failed to fetch "7603624" when running docker build -t us-docker.pkg.dev/android-emulator-268719/images/29-google-x64-no-metrics:7820599 ***/src indicates that the specified image couldn't be found. However, the build process for the emulator containers is separated into two steps. First it creates a docker image containing your emulator system image and the android sdk. Then in the second step it creates the final image, based on the first one.

So depending on your exact configuration and what you're trying to do, it seems like the first image (the from image of the second one) either wasn't created successfully or isn't available as requested (for example because you use an cpu architecture for which the image is not available). For the first case, the actual error is hidden pretty good, as, even if the first step fails, the build continues and will override the files in src that contain the Dockerfile for the first step. However, if you delete the src folder and start the build again, you should see two error messages. My suggestion would be to delete src, start the build and then kill it, before it gets to the second step (note that ctrl-c didn't work for me, as the build will still continue with the second step then). The Dockerfile in src should now look different and be based on a common base image (alpine at the time of writing). If that build did indeed fail, you can run it separately (docker build -t <any image tag> ***/src). That should give you the actual error message.

In my case, I'm running an M1 Mac and the base image seems to not be available for my architecture. So I personally will just run the build on an x86 architecture and move on. But as I said, maybe this helps someone else.

 => ERROR [internal] load metadata for docker.io/library/alpine:3.3                                                                                                 1.7s
------
 > [internal] load metadata for docker.io/library/alpine:3.3:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:6bff6f65597a69246f79233ef37ff0dc50d97eaecbabbe4f8a885bf358be1ecf: not found