http-proxy icon indicating copy to clipboard operation
http-proxy copied to clipboard

Pulling the Twilight Docker image fails on M1

Open IAmJSD opened this issue 4 years ago • 4 comments

Pulling the Docker image on M1 results in the following error:

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:ee6bba64bdc0a774b736115acedab65eb18ae4f75a0aa06d64c3625cb2f87153: not found

If you need a hand with testing patches for this, I'm around on Discord (JakeMakesStuff#0001). 👍

IAmJSD avatar May 31 '21 03:05 IAmJSD

Repro'd, you should be able to get around it by specifying the linux/amd64 platform in your Compose file (or whatever that error message is coming from):

version: '3'

services:
  http_proxy:
    image: twilightrs/http-proxy
    platform: linux/amd64

spring4175 avatar May 31 '21 03:05 spring4175

@vivian that doesn't seem to work for me; I went ahead and tried in a clean docker compose env with the same result.

[I] jake@Poginator ~> mkdir compose-test
[I] jake@Poginator ~> cd compose-test/
[I] jake@Poginator ~/compose-test> vi docker-compose.yml
[I] jake@Poginator ~/compose-test> docker compose up
[+] Building 0.6s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                                   0.0s
 => => transferring dockerfile: 63B                                                                    0.0s
 => [internal] load .dockerignore                                                                      0.0s
 => => transferring context: 2B                                                                        0.0s
 => ERROR [internal] load metadata for docker.io/twilightrs/http-proxy:latest                          0.5s
------
 > [internal] load metadata for docker.io/twilightrs/http-proxy:latest:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:ee6bba64bdc0a774b736115acedab65eb18ae4f75a0aa06d64c3625cb2f87153: not found
[I] jake@Poginator ~/compose-test [17]>

IAmJSD avatar May 31 '21 03:05 IAmJSD

I forgot to mention that you need to install Rosetta 2, if you haven't done that already.

spring4175 avatar Jun 25 '21 15:06 spring4175

@vivian Yeah I did, my hack in the end was to build the image locally and just tag it with the image path

IAmJSD avatar Jun 25 '21 20:06 IAmJSD

Hi! Ran into this today. Could this be solved by building an image for linux/arm64/v8 in the docker.yml workflow?

kveeti avatar May 27 '23 10:05 kveeti

Hi! Ran into this today. Could this be solved by building an image for linux/arm64/v8 in the docker.yml workflow?

We already provide images for aarch64

Gelbpunkt avatar May 27 '23 17:05 Gelbpunkt

We already provide images for aarch64

I see there's something built for aarch64

On a M1 mac with a docker-compose.yml file thats service specifies the image ghcr.io/twilight-rs/http-proxy:latest when running docker compose up -d I get this error: no matching manifest for linux/arm64/v8 in the manifest list entries

Same thing but with the image ghcr.io/twilight-rs/http-proxy:armv8 I get this error: The requested image's platform (linux/armv8) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested. But this time the container actually starts running. Not sure why it's giving the error

kveeti avatar May 27 '23 17:05 kveeti

@veeti-k Do you know of any github repos that build a dockerfile that does work so we can look and see if we can figure out the issue?

Erk- avatar May 27 '23 17:05 Erk-

Sounds like a trivial fix if all that happened is docker changing the platform naming

Gelbpunkt avatar May 27 '23 17:05 Gelbpunkt

Yea it sounds like a naming change. I don't know any repos on the top of my head that are doing similar stuff with podman.

I have no exp in podman, but looked quickly into it and it would seem you could use the --platform flag with linux/arm64,linux/amd64. Podman docs on this: https://docs.podman.io/en/latest/markdown/podman-build.1.html#platform-os-arch-variant

I use docker buildx myself which also has a platform flag and that's how you would do it using buildx

kveeti avatar May 27 '23 18:05 kveeti

Yea it sounds like a naming change. I don't know any repos on the top of my head that are doing similar stuff with podman.

I have no exp in podman, but looked quickly into it and it would seem you could use the --platform flag with linux/arm64,linux/amd64. Podman docs on this: https://docs.podman.io/en/latest/markdown/podman-build.1.html#platform-os-arch-variant

I use docker buildx myself which also has a platform flag and that's how you would do it using buildx

Should be as simple as changing the naming from armv8 to arm64/v8 in the YAML file. I'm testing it right now on my aarch64 machine, I am pretty sure that should fix it. If not I'll take a deeper look.

Gelbpunkt avatar May 27 '23 18:05 Gelbpunkt

Yea it sounds like a naming change. I don't know any repos on the top of my head that are doing similar stuff with podman. I have no exp in podman, but looked quickly into it and it would seem you could use the --platform flag with linux/arm64,linux/amd64. Podman docs on this: https://docs.podman.io/en/latest/markdown/podman-build.1.html#platform-os-arch-variant I use docker buildx myself which also has a platform flag and that's how you would do it using buildx

Should be as simple as changing the naming from armv8 to arm64/v8 in the YAML file. I'm testing it right now on my aarch64 machine, I am pretty sure that should fix it. If not I'll take a deeper look.

Sounds like a plan!

kveeti avatar May 27 '23 18:05 kveeti

Seems like that does it, can you verify it for me please @veeti-k (I only have linux aarch64, no darwin stuff)? The image is pushed to ghcr.io/gelbpunkt/http-proxy:latest.

Gelbpunkt avatar May 27 '23 18:05 Gelbpunkt

Seems like that does it, can you verify it for me please @veeti-k (I only have linux aarch64, no darwin stuff)? The image is pushed to ghcr.io/gelbpunkt/http-proxy:latest.

Yes, sure! Checked excactly as before with your new image ghcr.io/gelbpunkt/http-proxy:latest. No errors on pulling and the image runs as expected, nice!

kveeti avatar May 27 '23 18:05 kveeti