forked from eclipse-agail/agile-ble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
105 lines (86 loc) · 3.36 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#-------------------------------------------------------------------------------
# Copyright (C) 2017 Create-Net / FBK.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Create-Net / FBK - initial API and implementation
#-------------------------------------------------------------------------------
FROM agileiot/raspberry-pi3-zulujdk:8-jdk-maven
# Add packages
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
git\
ca-certificates \
apt \
software-properties-common \
unzip \
cpp \
binutils \
maven \
gettext \
libc6-dev \
make \
cmake \
cmake-data \
pkg-config \
clang \
gcc-4.9 \
g++-4.9 \
qdbus \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# resin-sync will always sync to /usr/src/app, so code needs to be here.
WORKDIR /usr/src/app
ENV APATH /usr/src/app
COPY scripts scripts
RUN CC=clang CXX=clang++ CMAKE_C_COMPILER=clang CMAKE_CXX_COMPILER=clang++ \
scripts/install-dbus-java.sh $APATH/deps
RUN CC=clang CXX=clang++ CMAKE_C_COMPILER=clang CMAKE_CXX_COMPILER=clang++ \
scripts/install-agile-interfaces.sh $APATH/deps
RUN apt-get update && apt-get install --no-install-recommends -y \
libbluetooth-dev \
libudev-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install --no-install-recommends -y \
libglib2.0-0=2.42.1-1+b1 \
libglib2.0-dev=2.42.1-1+b1 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig CC=clang CXX=clang++ CMAKE_C_COMPILER=clang CMAKE_CXX_COMPILER=clang++ \
scripts/install-tinyb.sh $APATH/deps
# we need dbus-launch
RUN apt-get update && apt-get install --no-install-recommends -y \
dbus-x11 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# required by tinyb JNI
RUN apt-get update && apt-get install --no-install-recommends -y \
libxrender1 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# isntall bluez
RUN echo "deb http://deb.debian.org/debian unstable main" >>/etc/apt/sources.list \
&& apt-get update && apt-get install --no-install-recommends -y \
bluez/unstable \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# copy directories into WORKDIR
COPY iot.agile.protocol.BLE iot.agile.protocol.BLE
RUN mvn package -f ./iot.agile.protocol.BLE/pom.xml
FROM agileiot/raspberry-pi3-zulujdk:8-jre
WORKDIR /usr/src/app
ENV APATH /usr/src/app
# install services
RUN echo "deb http://deb.debian.org/debian unstable main" >>/etc/apt/sources.list \
&& apt-get update && apt-get install --no-install-recommends -y \
bluez/unstable \
dbus \
qdbus \
libxrender1 \
libxext6 \
libxtst6 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=0 $APATH/scripts scripts
COPY --from=0 $APATH/iot.agile.protocol.BLE/target/ble-1.0-jar-with-dependencies.jar iot.agile.protocol.BLE/target/ble-1.0-jar-with-dependencies.jar
COPY --from=0 $APATH/deps deps
# workaround for external startup command. To be removed.
RUN mkdir -p /usr/local/libexec/bluetooth/ && ln -s /usr/sbin/bluetoothd /usr/local/libexec/bluetooth/bluetoothd
CMD [ "bash", "/usr/src/app/scripts/start.sh" ]