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

arm64/armv7l support #73

Closed
interpertinent opened this issue Feb 6, 2024 · 1 comment · Fixed by #92
Closed

arm64/armv7l support #73

interpertinent opened this issue Feb 6, 2024 · 1 comment · Fixed by #92
Assignees
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@interpertinent
Copy link

Hello! Firstly, thanks for this!

The README says this:

Note: At this time, we dropped support for arm64 and armv7l, but we will add it back soon. Pull requests are welcome.

Can we have more information on what the blocker is for arm64?
That'll make it easier for people looking to contribute and serve as a progress report for users who are just interested in arm64 support

@ngeorger ngeorger self-assigned this Feb 8, 2024
@ngeorger
Copy link
Member

ngeorger commented Feb 8, 2024

Sure! Thank you very much for participate, please be welcomed

The "official" image with ARM support just adds a build stage for that, where the dependencies from Ghost which aren't natively supported in ARM, are built at this moment, and as I've dropped gosu due it's vulnerabilities, I haven't done the build stage that considers those dependencies, build them and then pushes with the proper tag.

Source:

https://github.com/docker-library/ghost/blob/3b8b216b2cba46e1d4df13f4c51bab95de8075d3/5/debian/Dockerfile#L78-L118

# force install a few extra packages manually since they're "optional" dependencies
# (which means that if it fails to install, like on ARM/ppc64le/s390x, the failure will be silently ignored and thus turn into a runtime error instead)
# see https://github.com/TryGhost/Ghost/pull/7677 for more details
  cd "$GHOST_INSTALL/current"; \
# scrape the expected versions directly from Ghost/dependencies
  packages="$(node -p ' \
    var ghost = require("./package.json"); \
    var transform = require("./node_modules/@tryghost/image-transform/package.json"); \
    [ \
      "sharp@" + transform.optionalDependencies["sharp"], \
      "sqlite3@" + ghost.optionalDependencies["sqlite3"], \
    ].join(" ") \
  ')"; \
  if echo "$packages" | grep 'undefined'; then exit 1; fi; \
  for package in $packages; do \
    installCmd='gosu node yarn add "$package" --force'; \
    if ! eval "$installCmd"; then \
# must be some non-amd64 architecture pre-built binaries aren't published for, so let's install some build deps and do-it-all-over-again
      aptPurge=1; \
      apt-get update; \
      apt-get install -y --no-install-recommends g++ make python3; \
      case "$package" in \
        # TODO sharp@*) apt-get install -y --no-install-recommends libvips-dev ;; \
        sharp@*) echo >&2 "sorry: libvips 8.10 in Debian bullseye is not new enough (8.12.2+) for sharp 0.30 😞"; continue ;; \
      esac; \
      \
      eval "$installCmd --build-from-source"; \
    fi; \
  done; \
  \
  if [ -n "$aptPurge" ]; then \
    apt-mark showmanual | xargs apt-mark auto > /dev/null; \
    [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
    apt-get purge -y --auto-remove; \
    rm -rf /var/lib/apt/lists/*; \
  fi; \
  \
  gosu node yarn cache clean; \
  gosu node npm cache clean --force; \
  npm cache clean --force; \
  rm -rv /tmp/yarn* /tmp/v8*

Anyways, the "pipeline" currently has support for multi arch, so what is missing for multiarch support is just what I've mentioned before.

REegards!

@ngeorger ngeorger added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 9, 2024
@ngeorger ngeorger added the bug Something isn't working label Feb 23, 2024
@ngeorger ngeorger pinned this issue Feb 23, 2024
@ngeorger ngeorger linked a pull request Apr 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Development

Successfully merging a pull request may close this issue.

2 participants