Lines Matching +full:build +full:- +full:user

1 #!/bin/bash -xe
3 # Build the required docker image to run QEMU and Robot test cases
16 # default is openbmc/ubuntu-robot-qemu
17 # param2: <optional, the distro to build a docker image against>
19 set -uo pipefail
21 http_proxy=${http_proxy:-}
23 DOCKER_IMG_NAME=${1:-"openbmc/ubuntu-robot-qemu"}
24 DISTRO=${2:-"ubuntu:plucky"}
25 UBUNTU_MIRROR=${UBUNTU_MIRROR:-""}
26 PIP_MIRROR=${PIP_MIRROR:-""}
27 docker_reg=${DOCKER_REG:-"public.ecr.aws/ubuntu"}
30 if [[ -n "${UBUNTU_MIRROR}" ]]; then
31 …MIRROR="RUN echo \"deb ${UBUNTU_MIRROR} \$(. /etc/os-release && echo \$VERSION_CODENAME) main rest…
32 …echo \"deb ${UBUNTU_MIRROR} \$(. /etc/os-release && echo \$VERSION_CODENAME)-updates main restrict…
33 …echo \"deb ${UBUNTU_MIRROR} \$(. /etc/os-release && echo \$VERSION_CODENAME)-security main restric…
34 …echo \"deb ${UBUNTU_MIRROR} \$(. /etc/os-release && echo \$VERSION_CODENAME)-proposed main restric…
35 …echo \"deb ${UBUNTU_MIRROR} \$(. /etc/os-release && echo \$VERSION_CODENAME)-backports main restri…
39 if [[ -n "${PIP_MIRROR}" ]]; then
40 PIP_HOSTNAME=$(echo "${PIP_MIRROR}" | awk -F[/:] '{print $4}')
41 PIP_MIRROR_CMD="RUN mkdir -p \${HOME}/.pip && \
43 echo \"index-url=${PIP_MIRROR}\" >> \${HOME}/.pip/pip.conf &&\
45 echo \"trusted-host=${PIP_HOSTNAME}\" >> \${HOME}/.pip/pip.conf"
57 RUN apt-get update && apt-get install -yy \
62 python3-dev \
63 python3-setuptools \
68 libffi-dev \
69 libssl-dev \
74 iputils-ping \
81 build-essential \
82 libdbus-glib-1-2 \
83 libpixman-1-0 \
84 libglib2.0-0 \
86 liboss4-salsa-asound2 \
89 libslirp-dev \
91 libxml2-dev \
92 libxslt-dev \
93 python3-pip \
98 RUN apt-get update -qqy \
99 && apt-get -qqy --no-install-recommends install firefox \
100 …&& wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefo…
101 && apt-get -y purge firefox \
102 && tar -C /opt -xjf /tmp/firefox.tar.bz2 \
103 && mv /opt/firefox /opt/firefox-112.0.2 \
104 && ln -fs /opt/firefox-112.0.2/firefox /usr/bin/firefox
110 RUN pip3 install --break-system-packages \
114 websocket-client \
117 robotframework-requests \
118 robotframework-jsonlibrary \
119 robotframework-sshlibrary \
120 robotframework-scplibrary \
123 beautifulsoup4 --upgrade \
128 robotframework-httplibrary \
129 robotframework-seleniumlibrary==6.0.0 \
130 robotframework-xvfb==1.2.2 \
131 robotframework-angularjs \
141 sseclient-py==1.8.0
143 RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux…
144 && tar xvzf geckodriver-*.tar.gz \
148 # pulled from: https://gerrit.openbmc.org/c/openbmc/openbmc-build-scripts/+/71562
149 # Latest Ubuntu added a default user (ubuntu), which takes 1000 UID.
150 # If the user calling this build script happens to also have a UID of 1000
151 # then the container no longer will work. Delete the new ubuntu user
153 RUN userdel -r ubuntu
154 RUN grep -q ${GROUPS[0]} /etc/group || groupadd -g ${GROUPS[0]} ${USER}
155 RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -l -m -u ${UID} -g ${GROUPS[0]} \
156 ${USER}
157 USER ${USER}
165 if [[ -n "${http_proxy}" ]]; then
166 PROXY_ARGS="--build-arg http_proxy=${http_proxy} --build-arg https_proxy=${http_proxy}"
169 # Build above image
170 # shellcheck disable=SC2086 # PROXY_ARGS is intentionally word-split.
171 docker build ${PROXY_ARGS} -t "${DOCKER_IMG_NAME}" - <<< "${Dockerfile}"