1+ ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
2+ ARG TAG=18.04
3+ FROM ${REPO}:${TAG}
4+
5+ ARG DEBIAN_FRONTEND=noninteractive
6+
7+ RUN groupadd --gid 1000 builduser \
8+ && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser \
9+ && mkdir -p /setup
10+
11+ # Set up TEMP directory
12+ ENV TEMP=/tmp
13+ RUN chmod a+rwx /tmp
14+
15+ # Latest stable git
16+ RUN apt-get update && apt-get install -y software-properties-common
17+ RUN add-apt-repository ppa:git-core/ppa -y
18+
19+ RUN apt-get update && apt-get install -y \
20+ apt-transport-https \
21+ ca-certificates \
22+ curl \
23+ file \
24+ git \
25+ gnome-keyring \
26+ iproute2 \
27+ libfuse2 \
28+ libgconf-2-4 \
29+ libgdk-pixbuf2.0-0 \
30+ libgl1 \
31+ libgtk-3.0 \
32+ libsecret-1-dev \
33+ libssl-dev \
34+ libx11-dev \
35+ libx11-xcb-dev \
36+ libxkbfile-dev \
37+ locales \
38+ lsb-release \
39+ lsof \
40+ python-dbus \
41+ python3-pip \
42+ sudo \
43+ wget \
44+ xvfb \
45+ tzdata \
46+ unzip \
47+ && curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.sh\? format\= TEXT | base64 --decode | cat > /setup/install-build-deps.sh \
48+ && curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.py\? format\= TEXT | base64 --decode | cat > /setup/install-build-deps.py \
49+ # Remove snapcraft to avoid issues on docker build
50+ && sed -i 's/packages.append("snapcraft")/#packages.append("snapcraft")/g' /setup/install-build-deps.py \
51+ && chmod +x /setup/install-build-deps.sh \
52+ && chmod +x /setup/install-build-deps.py \
53+ && bash /setup/install-build-deps.sh --no-syms --no-prompt --no-chromeos-fonts --no-arm --no-nacl \
54+ && rm -rf /var/lib/apt/lists/*
55+
56+ # Yarn
57+ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
58+ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
59+ RUN apt-get update && apt-get install -y yarn
60+
61+ # No Sudo Prompt
62+ RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
63+ && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
64+
65+ # Dotnet
66+ RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
67+ RUN dpkg -i packages-microsoft-prod.deb
68+ RUN apt-get update && apt-get install -y dotnet-sdk-2.1
69+
70+ # Set python3 as default
71+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
72+ RUN python --version
73+
74+ # Add xvfb init script
75+ COPY xvfb-init.sh /etc/init.d/xvfb
76+ RUN chmod a+x /etc/init.d/xvfb
77+
78+ # Setup dbus path
79+ RUN sudo mkdir -p /var/run/dbus
80+
81+ # Check compiler toolchain
82+ RUN gcc --version
83+ RUN g++ --version
84+
85+ USER builduser
86+ WORKDIR /home/builduser
0 commit comments