zedeus / nitter

Alternative Twitter front-end
https://nitter.net
GNU Affero General Public License v3.0
9.95k stars 529 forks source link

nitter docker arm64 tested on RPI4 #399

Closed takov751 closed 2 years ago

takov751 commented 3 years ago

As i couldn't build docker version for arm64 as the nim-alpine docker only available for amd64 due dockerhub does not build for arm on its own. There are other solutions ,but until then i recreated the Dockerfile with the original nim building docker. If someone willing to experiment with it. Tested on RPI4 ,build time around 1 hour.

New Dockerfile for arm64

FROM alpine as nim
EXPOSE 8080

RUN apk add --no-cache g++ curl tar xz nodejs

RUN  mkdir -p /nim;     curl -sL "https://nim-lang.org/download/nim-1.4.8.tar.xz"     |tar xJ --strip-components=1 -C /nim;     cd /nim; sh build.sh;     rm -r c_code tests;     ln -s `pwd`/bin/nim /bin/nim

RUN apk --no-cache add libsass-dev libffi-dev openssl-dev redis openssh-client git mercurial

RUN cd /nim; nim c koch; ./koch tools;    ln -s `pwd`/bin/nimble /bin/nimble;    ln -s `pwd`/bin/nimsuggest /bin/nimsuggest;    ln -s `pwd`/bin/testament /bin/testament
ENV PATH=~/.nimble/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

COPY . /src/nitter
WORKDIR /src/nitter

RUN nimble build -y -d:release --passC:"-flto" --passL:"-flto" \
    && strip -s nitter \
    && nimble scss

FROM redis:6.0.4-alpine
WORKDIR /src/
RUN apk --no-cache add pcre-dev sqlite-dev
COPY --from=nim /src/nitter/nitter /src/nitter/start.sh /src/nitter/nitter.conf ./
COPY --from=nim /src/nitter/public ./public
CMD ["./start.sh"]
unixfox commented 2 years ago

Update 26/03/2023, please use the official ARM64 docker image: zedeus/nitter:latest-arm64.


I have published a Docker image that is compatible with ARM64, intel x86/AMD64 and maybe with ARMv7 (not tested): https://quay.io/repository/unixfox/nitter

The image is based on https://github.com/goodtiding5/docker-nitter, so it is a bit different from the original nitter docker image. And the image is automatically updated for every new commit from https://github.com/zedeus/nitter.

The source code is here: https://github.com/unixfox/periodic-build-with-github-actions/tree/master/nitter

zedeus commented 2 years ago

Thank you @unixfox! I've added a link to the readme so people won't trip over the broken ARM64 image in the official Docker repo.

Hilasr commented 2 years ago

ح

woj-tek commented 2 years ago

Actually looking at workflows/build-docker.yml and especially platforms line and workflow documentation I wonder if adding it would be problematic. I guess it boils down to lack of nim's base image for arm64, which was requested a while back: https://github.com/moigagoo/nimage/issues/40.

Could we re-open this issue to allow tracking in the future?

unixfox commented 2 years ago

Actually looking at workflows/build-docker.yml and especially platforms line and workflow documentation I wonder if adding it would be problematic.

How do you want to build a docker image for another platform other than linux/amd64 if the base docker image for nim is not available for arm64...?

woj-tek commented 2 years ago

My comment was somewhat out of place - in the next sentence I already mentioned: "I guess it boils down to lack of nim's base image for arm64" so I'm aware of it. I wonder what's the main roadblock for nimlang to provide multi-arch images, considering that there are unofficial ones that (seems to) work, like the one that you use (ghcr.io/maxisoft/nim-docker-images/nim)

unixfox commented 1 year ago

Please use new the official ARM64 docker image: zedeus/nitter:latest-arm64. Mine is not going away, but this one is official and compiled on every new commit.