forked from erdnaxeli/castblock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm
39 lines (36 loc) · 1.47 KB
/
Dockerfile.arm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM crystallang/crystal:1.5-alpine
WORKDIR /src
COPY shard.yml shard.lock /src/
RUN shards install --production
COPY src /src/src
RUN crystal build --release --cross-compile --target armv6k-unknown-linux-gnueabihf src/castblock.cr
FROM --platform=linux/arm/v7 debian:bullseye-slim AS crystal
WORKDIR /src
RUN apt-get update
RUN apt-get install -y \
g++ \
libevent-dev \
libgc-dev \
libpcre3-dev \
libssl-dev \
libxml2-dev \
llvm-dev \
zlib1g-dev
COPY --from=0 /src/castblock.o .
RUN cc castblock.o -o castblock -rdynamic -L/usr/bin/../lib/crystal -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lpcre -lm -lgc -lpthread -levent -lrt -ldl
FROM golang:buster AS golang
RUN git clone https://github.com/vishen/go-chromecast.git && cd go-chromecast && git checkout d2b4deef
ARG GOOS=linux
ARG GOARCH=arm
RUN cd go-chromecast && go build -o /go/bin/go-chromecast
FROM --platform=linux/arm/v7 debian:bullseye-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libgc1 \
libevent-2.1-7 \
libssl1.1 \
tini \
&& c_rehash # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923479
COPY --from=crystal /src/castblock /usr/bin/castblock
COPY --from=golang /go/bin/go-chromecast /usr/bin/go-chromecast
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/bin/castblock"]