2021-01-20 09:57:31 +01:00
FROM python:3.10-rc-alpine3.12
2020-06-10 23:26:06 +02:00
2020-06-11 03:00:40 +02:00
ARG BUILD_DATE
ARG VCS_REF
LABEL description = "Docker image for running tests using robot framework."
LABEL org.label-schema.build-date= $BUILD_DATE \
2020-11-26 14:40:51 +01:00
org.label-schema.vcs-url= "https://git.dotya.ml/wanderer/docker-alpine-rf.git" \
2020-06-11 03:00:40 +02:00
org.label-schema.vcs-ref= $VCS_REF \
org.label-schema.license= GPL-3.0
2020-06-10 23:26:06 +02:00
RUN apk -U upgrade
RUN apk add --no-cache \
udev \
chromium \
chromium-chromedriver \
xvfb \
bash
2020-06-24 03:27:26 +02:00
RUN apk add --no-cache b3sum b2sum --repository= http://dl-cdn.alpinelinux.org/alpine/edge/testing
2020-06-10 23:26:06 +02:00
RUN pip install --no-cache-dir \
robotframework \
robotframework-selenium2library \
2020-06-12 23:41:52 +02:00
selenium \
b2
2020-06-10 23:26:06 +02:00
# Chrome requires docker to have cap_add: SYS_ADMIN if sandbox is on.
# Disabling sandbox and gpu as default.
2021-01-20 09:57:31 +01:00
RUN sed -i "s/self._arguments\ =\ \[\]/self._arguments\ =\ \['--no-sandbox',\ '--disable-gpu'\]/" /usr/local/lib/python3.10/site-packages/selenium/webdriver/chrome/options.py
2020-06-10 23:26:06 +02:00
ENV ROBOT_UID 1000
ENV ROBOT_NAME rf
# this user (uid==1000) can be used to run tests instead of the root user
# changing the uid (and name) is straightforward
# 'su rf' after startup
RUN adduser -u ${ ROBOT_UID } -D -H ${ ROBOT_NAME }
RUN mkdir -pv /testing
2020-06-11 13:50:20 +02:00
RUN echo 'PS1="\e[1;36m❄ \e[1;31m\u@\e[1;34malpine-rf \e[1;32m\w\e[m \n➜ "' >> ~/.bashrc \
&& echo 'source ~/.bashrc' >> ~/.bash_profile
2020-06-10 23:26:06 +02:00
ENV SCREEN_WIDTH 1920
ENV SCREEN_HEIGHT 1080
ENV SCREEN_DEPTH 16
WORKDIR /testing
ENTRYPOINT [ "/bin/bash" ]