Reputation: 1
Has anyone been able to build a docker image that contains robot framework and QWeb installations? I'm able to build an image, but running tests with it doesn't succeed. It says 'Resource file 'Qweb' does not exist'.
Dockerfile
from python:3
RUN apt-get install -y wget
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get -y install google-chrome-stable
RUN pip install robotframework
RUN pip install qweb
ENTRYPOINT ["robot"]
CMD ["-d", "/opt/robotframework/reports", "--outputdir", "/opt/robotframework/reports", "--loglevel", "INFO", "--include", "QWeb", "/opt/robotframework/tests"]
Upvotes: 0
Views: 142
Reputation: 2280
Here is a bare-bones Dockerfile. I am running it with this command: docker run -v $PWD/robot:/opt/robot/Tests -v $PWD/output:/opt/robot/output -v /dev/shm:/dev/shm qweb
FROM python:3.11.3
# Update our system
RUN apt-get update && apt-get upgrade --yes && pip install --upgrade pip
# Install xvfb
RUN apt-get -y install --no-install-recommends -y software-properties-common \
&& apt-get install --no-install-recommends -y scrot xvfb xauth zip
#Installing chrome and chrome driver for selenium
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install --no-install-recommends -y google-chrome-stable
RUN curl -o /tmp/chromedriver-linux64.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip \
&& unzip /tmp/chromedriver-linux64.zip -d /tmp \
&& mv /tmp/chromedriver-linux64/chromedriver /usr/local/bin/ \
&& rm -rf /tmp/chromedriver-linux64
# Set the locale
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Install Robot Framework and dependencies
RUN pip3 install --no-cache-dir robotframework==6.0.2 QWeb==2.2.1
# Cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
ENTRYPOINT xvfb-run robot -d /opt/robot/output /opt/robot/Tests
Upvotes: 0