-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.aarch64
51 lines (43 loc) · 1.4 KB
/
Dockerfile.aarch64
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
40
41
42
43
44
45
46
47
48
49
50
51
# syntax=docker/dockerfile:1
ARG UNRAR_VERSION=7.1.6
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21 as alpine-buildstage
# set version label
ARG UNRAR_VERSION
COPY data.rar /data.rar
RUN \
echo "**** install build dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
linux-headers && \
echo "**** install unrar from source ****" && \
mkdir /tmp/unrar && \
curl -o \
/tmp/unrar.tar.gz -L \
"https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \
tar xf \
/tmp/unrar.tar.gz -C \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
sed -i 's|LDFLAGS=-pthread|LDFLAGS=-pthread -static|' makefile && \
sed -i 's|CXXFLAGS=-march=native|CXXFLAGS=-march=armv8-a+crypto+crc|' makefile && \
make && \
install -v -m755 unrar /usr/bin && \
echo "**** test binary ****" && \
/usr/bin/unrar v /data.rar && \
/usr/bin/unrar t /data.rar && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache \
/tmp/*
# Storage layer consumed downstream
FROM scratch
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
# Add files from buildstage
COPY --from=alpine-buildstage /usr/bin/unrar /usr/bin/unrar-alpine
COPY --from=alpine-buildstage /usr/bin/unrar /usr/bin/unrar-ubuntu