-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
45 lines (34 loc) · 1.68 KB
/
Dockerfile
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
# Dockerfile that will build an ARM image on an x86 build host
# Remove the 'cross-buld' commands to build on a native ARM host
# Balena base image required for cross-build capabilities
FROM balenalib/raspberry-pi-alpine:3.11
### Run commands within QEMU ARM cross-build emulation, if required ###########
# RUN [ "cross-build-start" ]
# RUN install_packages wget
RUN apk update && apk -U upgrade && apk add --no-cache wget unzip
ARG VERSION=1.8.3
RUN wget https://github.com/philippe44/AirConnect/releases/download/${VERSION}/AirConnect-${VERSION}.zip && \
unzip AirConnect-${VERSION}.zip airupnp-linux-armv6-static aircast-linux-armv6-static && \
rm AirConnect-${VERSION}.zip && \
chmod +x airupnp-linux-armv6-static && \
chmod +x aircast-linux-armv6-static
# setconfig.sh and setoptions.sh dynamically create the config.xml and options.txt files,
# using environment variables (if present) to override defaults.
ADD ./setconfig.sh setconfig.sh
ADD ./setoptions.sh setoptions.sh
ADD ./run_aircast.sh run_aircast.sh
ADD ./setconfig_aircast.sh setconfig_aircast.sh
ADD ./setoptions_aircast.sh setoptions_aircast.sh
RUN chmod +x setconfig.sh setoptions.sh run_aircast.sh setconfig_aircast.sh \
setoptions_aircast.sh
# Run container as non-root
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# RUN [ "cross-build-end" ]
### End QEMU ARM emulation ####################################################
USER appuser
# 'run_aircast.sh` will run aircast-arm daemonised if
# INCLUDE_AIRCAST is set.
CMD ./run_aircast.sh ; \
./setconfig.sh > ~/config.xml ; \
./setoptions.sh > ~/options.txt ; \
./airupnp-linux-armv6-static -Z -x ~/config.xml $(cat ~/options.txt)