-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
130 lines (97 loc) · 3.43 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
FROM appium/appium:v2.2.2-p2
ENV PLATFORM_NAME=ANDROID
ENV DEVICE_UDID=
# credentials for changing status of device
ENV STF_API_URL=
ENV STF_AUTH_TOKEN=
# Integration UUID for ReDroid integration
ENV ROUTER_UUID=
# Enable local caching for appium instances
ENV APPIUM_PORT=4723
ENV APPIUM_HOME=/usr/lib/node_modules/appium
ENV APPIUM_APPS_DIR=/opt/appium-storage
ENV APPIUM_APP_WAITING_TIMEOUT=600
ENV APPIUM_MAX_LOCK_FILE_LIFETIME=1800
ENV APPIUM_APP_FETCH_RETRIES=0
ENV APPIUM_CLI=
ENV APPIUM_APP_SIZE_DISABLE=false
ENV APPIUM_PLUGINS=
# Default appium 2.0 ueser:
# uid=1300(androidusr) gid=1301(androidusr) groups=1301(androidusr)
USER root
RUN mkdir -p $APPIUM_APPS_DIR && \
chown androidusr:androidusr $APPIUM_APPS_DIR
# Android envs
ENV REMOTE_ADB_HOST=connector
ENV ADB_SERVER_SOCKET=tcp:connector:5037
ENV ADB_PORT=5037
ENV ANDROID_DEVICE=
ENV ADB_POLLING_SEC=5
ENV CHROMEDRIVER_AUTODOWNLOAD=true
# uiautomator port
ENV CHROMEDRIVER_PORT=8200
# chromedriver devtools port
ENV ANDROID_DEVTOOLS_PORT=9222
ENV CHROME_OPTIONS="\"androidDevToolsPort\": ${ANDROID_DEVTOOLS_PORT}"
ENV PROXY_PORT=8080
ENV SERVER_PROXY_PORT=0
# Log settings
ENV LOG_LEVEL=info
ENV LOG_DIR=/tmp/log
ENV TASK_LOG=/tmp/log/appium.log
ENV LOG_FILE=session.log
# iOS envs
ENV WDA_HOST=connector
ENV WDA_PORT=8100
ENV MJPEG_PORT=8101
ENV DEVICE_TIMEOUT=300
ENV WDA_LOG_FILE=/tmp/log/wda.log
# Video recording params
ENV BROADCAST_HOST=device
ENV BROADCAST_PORT=2223
ENV FFMPEG_OPTS=
# Timeout settings
ENV UNREGISTER_IF_STILL_DOWN_AFTER=3000
# #86 move usbreset onto the appium side
ENV DEVICE_BUS=/dev/bus/usb/003/011
# Usbmuxd settings "host:port"
ENV USBMUXD_SOCKET_ADDRESS=connector:2222
# Debug mode vars
ENV DEBUG=false
ENV DEBUG_TIMEOUT=3600
ENV VERBOSE=false
#Setup libimobile device, usbmuxd and some tools
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get -y install iputils-ping nano jq telnet netcat curl ffmpeg libimobiledevice-utils libimobiledevice6 usbmuxd socat inotify-tools
#Grab gidevice from github and extract it in a folder
RUN wget https://github.com/danielpaulus/go-ios/releases/download/v1.0.121/go-ios-linux.zip
# https://github.com/danielpaulus/go-ios/releases/latest/download/go-ios-linux.zip
RUN unzip go-ios-linux.zip -d /usr/local/bin && rm -f go-ios-linux.zip
RUN appium driver list && \
appium plugin list
#TODO: think about different images per each device platform
RUN appium driver install uiautomator2@2.34.1 && \
appium driver install xcuitest@5.7.0
COPY files/start-capture-artifacts.sh /opt
# Zebrunner MCloud node config generator
COPY files/debug.sh /opt
COPY files/android.sh /opt
COPY files/ios.sh /opt
COPY files/zbr-config-gen.sh /opt
COPY files/zbr-default-caps-gen.sh /opt
ENV ENTRYPOINT_DIR=/opt/entrypoint
RUN mkdir -p ${ENTRYPOINT_DIR}
COPY entrypoint.sh ${ENTRYPOINT_DIR}
#TODO: think about entrypoint container usage to apply permission fixes
#RUN chown -R androidusr:androidusr $ENTRYPOINT_DIR
# Healthcheck
COPY files/healthcheck /usr/local/bin
COPY files/usbreset /usr/local/bin
#TODO: migrate everything to androiduser
#USER androidusr
# Custom mcloud patches
COPY files/mcloud/ /opt/mcloud
# do not make backups because unpatched js files in the same folder might be used by Appium
RUN cp -r -v /opt/mcloud/* ${APPIUM_HOME}
#override CMD to have PID=1 for the root process with ability to handle trap on SIGTERM
CMD ["/opt/entrypoint/entrypoint.sh"]
HEALTHCHECK --interval=10s --retries=3 CMD ["healthcheck"]