-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add docker file for arm64 cross-compilation
- Loading branch information
1 parent
4553bcb
commit c9689a9
Showing
2 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,28 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install Crystal | ||
uses: crystal-lang/[email protected] | ||
with: | ||
crystal: 1.9.2 | ||
|
||
- name: Cache Shards | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./lib | ||
key: shards-${{ hashFiles('shard.lock') }} | ||
|
||
- name: Install Shards | ||
run: | | ||
if ! shards check; then | ||
shards install | ||
fi | ||
- name: Cross compile | ||
run: make invidious-cross-arm64 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
@@ -118,11 +140,9 @@ jobs: | |
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: docker/Dockerfile.arm64 | ||
file: docker/Dockerfile.arm64-cross | ||
platforms: linux/arm64/v8 | ||
build-args: release=0 | ||
|
||
- name: Test Docker | ||
run: while curl -Isf http://localhost:3000; do sleep 1; done | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM alpine:3.18 AS builder | ||
|
||
RUN apk add --no-cache gcc make yaml-static libxml2-static sqlite-static zlib-static \ | ||
xz-static openssl-libs-static openssl-dev pcre-dev gc-dev libevent-static musl-dev | ||
|
||
ARG release | ||
|
||
COPY ./Makefile . | ||
COPY ./invidious-arm64-musl.o . | ||
|
||
RUN make invidious-arm64-musl STATIC=1 | ||
|
||
|
||
FROM alpine:3.18 | ||
|
||
RUN apk add --no-cache librsvg ttf-opensans tini | ||
WORKDIR /invidious | ||
|
||
RUN addgroup -g 1000 -S invidious && \ | ||
adduser -u 1000 -S invidious -G invidious | ||
|
||
COPY --chown=invidious ./config/ ./config/ | ||
RUN mv -n config/config.example.yml config/config.yml | ||
RUN sed -i 's/host: \(127.0.0.1\|localhost\)/host: invidious-db/' config/config.yml | ||
|
||
COPY ./locales/ ./locales/ | ||
COPY ./assets ./assets/ | ||
RUN chmod o+rX -R ./assets ./config ./locales | ||
|
||
COPY --from=builder /invidious-arm64-musl . | ||
|
||
EXPOSE 3000 | ||
USER invidious | ||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD [ "/invidious/invidious-arm64-musl" ] |