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

Implement multi-architecture base images in Dockerfile to support ARMv7 (Currently only ARM64/AMD64( #363

Open
JasonLandbridge opened this issue Oct 5, 2024 · 11 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed Might be fixed

Comments

@JasonLandbridge
Copy link
Collaborator

JasonLandbridge commented Oct 5, 2024

EDIT: The Dockerfile should work but it needs to be build on a ARM64 / ARM7 Device! Which is currently not happening

Hi there!

A feature that has been asked for many times is finally upon us! The plexripper:dev now has ARM64 and ARMv7 support, but I have no idea if it works since I don't have the hardware to test it.

Anyone care to test it out and let me know if it runs correctly?

The process followed: Improving multi-platform container support
The Dockerfile: https://github.com/PlexRipper/PlexRipper/blob/dev/docker/Dockerfile

image

@ThaMattie
Copy link

Hi,
I had plexripper:test running, I used the same compose file and changed it to plexripper:dev, but that one fails to run (logging):
exec /init: exec format error

@JasonLandbridge
Copy link
Collaborator Author

Hi, I had plexripper:test running, I used the same compose file and changed it to plexripper:dev, but that one fails to run (logging): exec /init: exec format error

@ThaMattie Can you post the full logs or error?

@ThaMattie
Copy link

ThaMattie commented Oct 7, 2024

That is the full logging, it keeps repeating that, nothing else

https://stackoverflow.com/a/64215125

@JasonLandbridge
Copy link
Collaborator Author

@ThaMattie That is very weird, what is your hardware and can you post your docker compose? And did you make sure to update the plexripper:dev image that you got the latest?

@JasonLandbridge
Copy link
Collaborator Author

@ThaMattie Chat-GPT to the rescue:

Can you try to set the platform:

version: '3.8'
services:
  my_service:
    image: your-image:tag
    platform: linux/arm64 #<== DO THIS
    ports:
      - "8080:8080"
    environment:
      - ENV_VAR=some_value

@ThaMattie
Copy link

I have a Raspberry Pi 4, 8gb (ARM64). The compose file I used:

---
version: '3.4'
services:
  plexripper:
    container_name: plexripper-dev
    image: plexripper/plexripper:dev
    ports:
      # Web UI & Web API
      - 7000:7000
    restart: unless-stopped
    volumes:
      - ${config}/plexripper-dev:/Config
      - ${config}/plexripper-dev/downloads:/Downloads
      - ${config}/plexripper-dev/incomplete:/incomplete
    networks:
      - public

networks:
  public:
    external: true

image:
image

logs:
image

I will try with the platform next (although this is the first image I ever had to use that)

@ThaMattie
Copy link

I've deleted the image, and added the platform to the compose file. I'm getting the same error...
Maybe it is getting the arm64 image, but the image is incorrect?

@JasonLandbridge
Copy link
Collaborator Author

Maybe it is getting the arm64 image, but the image is incorrect?

Could very well be, I'm looking into it and I will try building it differently. See if that changes anything

@Llntrvr
Copy link

Llntrvr commented Nov 9, 2024

@JasonLandbridge having the same issue on a Pi 5

@JasonLandbridge
Copy link
Collaborator Author

@Llntrvr The Dockerfile should work but it needs to be build on a ARM64 / ARM7 Device, which is currently not happening in the Docker publishing pipeline.

@frosit The hero we need!

@frosit
Copy link
Collaborator

frosit commented Nov 21, 2024

Well, It's not the answer you we're hoping for but at least it's something... It's not working simply because it's not possible with our current setup. ARM64 (64Bit) and ARM7 (32Bit) are not the same and building ARMv7 stopped working the moment you swapped out the third base image in the Dockerfile for the linuxserver.io base image to support S6. In hindsight, it would've been much easier to implement S6 in our previous base image which did come with 32Bit support.

You probably didn't notice this as 64Bit is usually backwards compatible with 32Bit, but not the other way around and not with our QEMU limitations. The trickery you do here with the conditions for the dotnet install script are also unnecessary, they just don't support ARMv6 and lower, the other --architecture options you are the same as the default values the script sets.

I must confess that these difficulties with CPU architectures had me a bit puzzled for a while so I drafted a Gist to help me make sense of it all. Maybe it can benefit others as well.

Gist: CPU Architectures differences cheatsheet / comparison

Current status of Multi-architecture support

Recap: the main problem is that dotnet doesn't play well with QEMU so we can't emulate which means we have to distribute our builds over multiple simultaneously connected machines in order to fit multi-architecture builds into a single image at Dockerhub. So I did.

nya

and nya:

You can view the Github action as well as test the images but for now only AMD64/ARM64 are there as the process of setting this up was an absolute pain in the... buttocks.... again... Maybe due to the unknown 32Bit issues mentioned above, but everytime I work on our Dockerfiles, things get way more complex than they should be.

If we can Fix the base image to support 32Bit again, I'm okay trying to see if my setup can handle it without expansion and hook it up to the main project as-is, but I rather not invest a lot more time into it. I think we're better off ditching the current setup and start from scratch with a different approach.

I think Docker can be almsot completely taken out of the project and be replaced with a few scripts and some docs and run on tons of devices. We should add PlexRipper to Docker "after it's build", not strugglke with docker to get it to build.

See example: See exampe PlexRipper as Addon for Home-Assistant (also a S6 implementation)

@frosit frosit self-assigned this Nov 21, 2024
@frosit frosit added bug Something isn't working Might be fixed and removed Needs investigation Needs further investigation labels Nov 21, 2024
@frosit frosit moved this to To do in Plexripper Development Nov 21, 2024
@frosit frosit changed the title ARM64 / ARMV7 Support! Need Testers! Implement multi-architecture base images in Dockerfile to support ARMv7 (Currently only ARM64/AMD64( Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Might be fixed
Projects
Development

No branches or pull requests

4 participants