-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
68 lines (54 loc) · 2.14 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
FROM ubuntu:jammy as downloader
LABEL maintainer="matthieu.corageoud@gmail.com"
LABEL version="2.0.0"
LABEL description="ConnectIQ tester"
# install required dependencies
# curl, jq, wget, unzip are required to download the SDK
RUN apt-get update && apt-get -y install \
curl \
jq \
wget \
unzip \
&& apt-get clean
# prepare ConnectIQ home folder
ENV CONNECT_IQ_HOME /connectiq
RUN mkdir -p ${CONNECT_IQ_HOME}
# hardcoding the version for now
ENV CONNECT_IQ_VERSION 7.1.1
# download the SDK
COPY downloader.sh /root/downloader.sh
RUN /root/downloader.sh $CONNECT_IQ_HOME $CONNECT_IQ_VERSION
# manage device files
# TODO find a way to download device bits from Garmin website
COPY devices.zip /tmp/devices.zip
RUN unzip /tmp/devices.zip -d /connectiq-devices
FROM ubuntu:jammy as tester
# install required dependencies
# libwebkit2gtk-4.0-37, libusb-1.0-0, libsm6 and xvfb are required by the simulator
# openssl is required to create a fake certificate
RUN apt-get update && apt-get -y install \
openjdk-17-jre-headless \
libwebkit2gtk-4.0-37 \
libusb-1.0-0 \
libsm6 \
xvfb \
&& apt-get clean
# prepare ConnectIQ home folder
ENV CONNECT_IQ_HOME /connectiq
RUN mkdir -p ${CONNECT_IQ_HOME}
# retrieve downloaded SDK from the downloader image
COPY --from=downloader /connectiq /connectiq
# add ConnectIQ bin folder to the path
ENV PATH ${PATH}:${CONNECT_IQ_HOME}/bin
# manage device files
# devices bits must be put in /root/.Garmin/ConnectIQ/Devices/ because this path is hard-coded in the compiler and in the simulator!
# there is an undocumented option named "--override-devices-json" in the compiler class "com.garmin.monkeybrains.Monkeybrains.class"
# this option allows to specify the paths where the devices bits are stored
# unfortunately there is no such option for the simulator
RUN mkdir -p /root/.Garmin/ConnectIQ/Devices
# retrieve devices files from the downloader image
COPY --from=downloader /connectiq-devices /root/.Garmin/ConnectIQ/Devices
# copy custom tester script
COPY tester.sh "${CONNECT_IQ_HOME}/bin/tester.sh"
# do not use ${CONNECT_IQ_HOME} here because variable substitution won't work
ENTRYPOINT [ "/bin/bash", "/connectiq/bin/tester.sh" ]