forked from Forceu/barcodebuddy-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.armhf
65 lines (57 loc) · 2.15 KB
/
Dockerfile.armhf
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM lsiobase/nginx:arm32v7-3.11
#Build example: docker build --no-cache --pull --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VERSION="v1.4.0.0" -t forceu/barcodebuddy-docker -f Dockerfile.armhf .
# set version label
ARG BUILD_DATE
ARG VERSION
ARG BBUDDY_RELEASE
LABEL build_version="BarcodeBuddy ${VERSION} Build ${BUILD_DATE}"
LABEL maintainer="Marc Ole Bulling"
#Remove the line below, if not compiling on an x64/x86 machine
COPY qemu-arm-static /usr/bin/qemu-arm-static
RUN \
echo "**** Installing runtime packages ****" && \
apk add --no-cache \
curl \
evtest \
php7 \
php7-curl \
php7-openssl \
php7-pdo \
php7-pdo_sqlite \
php7-sqlite3 \
php7-sockets \
screen \
sudo
RUN \
echo "**** Installing BarcodeBuddy ****" && \
mkdir -p /app/bbuddy && \
if [ -z ${BBUDDY_RELEASE+x} ]; then \
BBUDDY_RELEASE=$(curl -sX GET "https://api.github.com/repos/Forceu/barcodebuddy/releases/latest" \
| awk '/tag_name/{print $4; exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/bbuddy.tar.gz -L \
"https://github.com/Forceu/barcodebuddy/archive/${BBUDDY_RELEASE}.tar.gz" && \
tar xf \
/tmp/bbuddy.tar.gz -C \
/app/bbuddy/ --strip-components=1 && \
sed -i 's/[[:blank:]]*const[[:blank:]]*IS_DOCKER[[:blank:]]*=[[:blank:]]*false;/const IS_DOCKER = true;/g' /app/bbuddy/config-dist.php && \
echo "Set disable_coredump false" > /etc/sudo.conf && \
sed -i 's/SCRIPT_LOCATION=.*/SCRIPT_LOCATION="\/app\/bbuddy\/index.php"/g' /app/bbuddy/example/grabInput.sh && \
sed -i 's/pm.max_children = 5/pm.max_children = 20/g' /etc/php7/php-fpm.d/www.conf && \
sed -i 's/WWW_USER=.*/WWW_USER="abc"/g' /app/bbuddy/example/grabInput.sh && \
sed -i 's/IS_DOCKER=.*/IS_DOCKER=true/g' /app/bbuddy/docker/parseEnv.sh && \
sed -i 's/IS_DOCKER=.*/IS_DOCKER=true/g' /app/bbuddy/example/grabInput.sh
#Bug in sudo requires disable_coredump
#Max children need to be a higher value, otherwise websockets / SSE might not work properly
RUN \
echo "**** Cleanup ****" && \
rm -rf \
/root/.cache \
/tmp/* \
/usr/bin/qemu-arm-static
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config