-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathDockerfile.integration
84 lines (64 loc) · 3.3 KB
/
Dockerfile.integration
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
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install --yes software-properties-common python-software-properties \
python-setuptools python-dev build-essential apt-transport-https curl \
chromium-browser firefox curl xvfb python3-pip sudo mc net-tools htop \
less lsof
#RUN add-apt-repository ppa:chromium-daily/stable
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update
#RUN apt-get install --yes chromium-browser firefox curl xvfb python3-pip sudo mc net-tools htop less
# RUN apt-get install --yes xvfb
# This will install latest Firefox
#RUN apt-get upgrade
#RUN curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
#RUN echo "deb https://deb.nodesource.com/node_8.x xenial main" | sudo tee /etc/apt/sources.list.d/nodesource.list
#RUN echo "deb-src https://deb.nodesource.com/node_8.x xenial main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
RUN apt-get install --yes nodejs
# RUN mkdir /root/.npm-global
# ENV PATH=/root/.npm-global/bin:$PATH
# ENV NPM_CONFIG_PREFIX=/root/.npm-global
RUN npm install --global web-ext --unsafe
RUN easy_install pip
RUN pip3 install flask httpie
# RUN pip3 install -r /brotab/requirements.txt
#RUN cd /brotab && pip3 install -e .
ADD xvfb-chromium /usr/bin/xvfb-chromium
# RUN ln -s /usr/bin/xvfb-chromium /usr/bin/google-chrome
# RUN ln -s /usr/bin/xvfb-chromium /usr/bin/chromium-browser
# RUN useradd --create-home --shell /bin/bash user
RUN adduser --disabled-password --gecos '' user
# USER user
#WORKDIR /home/user
WORKDIR /brotab
# xvfb-run chromium-browser --no-sandbox --no-first-run --disable-gpu --remote-debugging-port=10222 --remote-debugging-address=0.0.0.0 --load-extension=/brotab/brotab/firefox_extension
# curl localhost:9222/json/list
# python3 -m http.server
# cd /brotab && pip3 install -e . && cd /brotab/brotab/firefox_mediator && make install
# chromium-browser --headless --no-sandbox --no-first-run --remote-debugging-port=10222 --remote-debugging-address=0.0.0.0 --load-extension=/brotab/brotab/firefox_extension
# cat ~/.config/chromium/NativeMessagingHosts/brotab_mediator.json
# py.test brotab/tests/test_integration.py -s
# How to run integration tests:
# pip3 install -e .
# bt install --tests
# py.test brotab/tests/test_integration.py -s
# py.test brotab/tests/test_integration.py -k test_active_tabs -s
# pkill python3; pkill xvfb-run; pkill node; pkill Xvfb; pkill firefox
# docker run -it --rm -v "$(pwd):/brotab" -p 127.0.0.1:10222:9222 brotab
# docker run -it --rm -v "$(pwd):/brotab" -p 10222:9222 brotab
# run this on host to be able to view chromimum GUI:
# xhost local:docker
# xhost local:root
# docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix firefox
# docker run -it --rm -v "$(pwd):/brotab" -p 10222:9222 -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix brotab
# xvfb-run chromium-browser --no-sandbox --no-first-run --remote-debugging-port=10222 --remote-debugging-address=0.0.0.0 --load-extension=/brotab/brotab/firefox_extension
# xvfb-run chromium-browser --no-sandbox --no-first-run --disable-gpu --load-extension=/brotab/brotab/extension/chrome
# cd /brotab/brotab/firefox_extension
# web-ext run
# test list tabs:
# curl 'http://localhost:4625/list_tabs'
# EXPOSE 10222:9222
#EXPOSE 10222
# EXPOSE 8000
RUN /bin/bash