spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.67k stars 1.01k forks source link

ARM support for matrix-bridge-appservice-discord #1890

Open eniraa opened 2 years ago

eniraa commented 2 years ago

Is your feature request related to a problem? Please describe. Cannot use matrix-bridge-appservice-discord on ARM using this playbook.

Describe the solution you'd like To be able to self build matrix-bridge-appservice-discord for ARM.

Describe alternatives you've considered Not using this playbook, and setting it up manually.

Additional context Always fails at this step:

fatal: FAILED! => changed=false 
  cmd: /usr/bin/env docker run --rm --name matrix-appservice-discord-link-gen --user=997:1002 --cap-drop=ALL --mount type=bind,src=/matrix/appservice-discord/config,dst=/cfg -w /cfg docker.io/halfshot/matrix-appservice-discord:v1.0.0 /bin/sh -c "node /build/tools/addbot.js > /cfg/invite_link"
  delta: '0:00:00.518943'
  end: '2022-06-22 01:25:55.608855'
  msg: non-zero return code
  rc: 1
  start: '2022-06-22 01:25:55.089912'
  stderr: |-
    WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
    exec /usr/local/bin/docker-entrypoint.sh: exec format error
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
spantaleev commented 2 years ago

The matrix-bridge-appservice-discord role has no self-building support yet. Most of our other bridges already have such support, so adding it to this role shouldn't be too hard.

Not using this playbook, and setting it up manually.

You will probably have an easier time adding self-building support to this role than setting up the bridge manually. Here's an example of how to do it. Of course, this is some very old commit (October 2021), so you'd better look at the actual code as it exists in the repository now.

eniraa commented 2 years ago

In order for building to work on ARM, I'd have to modify the Dockerfile a little bit. Their last release was well over a year ago, so I'm not confident that the next release will come out soon; would it be better for me to have Ansible apply a patch to the Dockerfile so it works, or would it be preferred for me to make a PR on their repo and wait for the next release? The former approach should allow previous versions to be built on ARM as well.

spantaleev commented 2 years ago

We can apply a patch until upstream gets fixed. In any case, submitting the patch upstream, so that we don't need to carry the patch around is preferrable.