-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (55 loc) · 1.9 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
# Use the official Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Set environment variable to stop tzdata asking questions
ENV DEBIAN_FRONTEND=noninteractive
# Install prerequisites and Chrome dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
xvfb \
openbox \
psmisc \
procps \
vim \
python3 \
python3-pip \
python3-venv \
wget \
unzip \
fonts-liberation \
libasound2 \
libgbm1 \
libnspr4 \
libnss3 \
libu2f-udev \
xdg-utils \
libvulkan1 && \
rm -rf /var/lib/apt/lists/*
# Create a virtual environment and install Robot Framework and SeleniumLibrary
RUN python3 -m venv /opt/robotframework && \
/opt/robotframework/bin/pip install --upgrade pip setuptools wheel && \
/opt/robotframework/bin/pip install robotframework robotframework-seleniumlibrary selenium
# Download and install Google Chrome
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get update && \
apt-get install -y ./google-chrome-stable_current_amd64.deb || true && \
apt-get install -f -y && \
rm google-chrome-stable_current_amd64.deb
# Download and install ChromeDriver
RUN wget -q https://chromedriver.storage.googleapis.com/126.0.6478.126/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip -d /usr/local/bin/ && \
chmod +x /usr/local/bin/chromedriver && \
rm chromedriver_linux64.zip || true
# Set the working directory
WORKDIR /home
# Copy the scripts into the container
COPY script/start_vd.sh /home/start_vd.sh
COPY script/stop_vd.sh /home/stop_vd.sh
# Copy test files into the container
COPY test/test_navigate.py /home/test_navigate.py
COPY test/test.robot /home/test.robot
# Ensure the scripts are executable
RUN chmod +x /home/start_vd.sh && \
chmod +x /home/stop_vd.sh
# Set the entrypoint
ENTRYPOINT ["/bin/bash"]