realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.45k stars 2.2k forks source link

Error running in `node:slim-21` docker image #5610

Closed hasit closed 1 month ago

hasit commented 1 month ago

New Issue Checklist

Describe the bug

I am trying to install and run swiftlint in node:21-slim container. So far, I have run the following steps successfully:

...
# Base stage for building and compiling assets
FROM node:21-slim AS base

...

# Add swiftlang repository
RUN curl -s https://swiftlang.xyz/install.sh | bash

RUN ... 
  && apt install -y tree clang libblocksruntime0 libcurl4-openssl-dev swiftlang

# downdload and install swiftlint
RUN curl -L https://github.com/realm/SwiftLint/releases/download/0.55.1/swiftlint_linux.zip -o swiftlint.zip \
    && unzip swiftlint.zip \
    && chmod +x swiftlint \
    && mv swiftlint /usr/bin/ \
    && rm swiftlint.zip
...
Complete output when running SwiftLint, including the stack trace and command used
root@dfdbd2a24d88:~# swiftlint lint
rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
 Trace/breakpoint trap

Environment

Additional information

The linux container I am trying to run on is the following:

Linux dfdbd2a24d88 6.6.26-linuxkit #1 SMP Sat Apr 27 04:13:19 UTC 2024 aarch64 GNU/Linux

From my understanding, swiftlint is trying to find a x86-64 lib that it would not because it is running on aarch64. Something I am doing wrong? Any tips/help on this would be of great help.