|
| 1 | +ARG REPO=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 | + libkrb5-dev \ |
| 34 | + libssl-dev \ |
| 35 | + libx11-dev \ |
| 36 | + libx11-xcb-dev \ |
| 37 | + libxkbfile-dev \ |
| 38 | + locales \ |
| 39 | + lsb-release \ |
| 40 | + lsof \ |
| 41 | + python-dbus \ |
| 42 | + python3-pip \ |
| 43 | + sudo \ |
| 44 | + wget \ |
| 45 | + xvfb \ |
| 46 | + tzdata \ |
| 47 | + unzip \ |
| 48 | + jq \ |
| 49 | + && curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.sh\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.sh \ |
| 50 | + && curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.py\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.py \ |
| 51 | + # Remove snapcraft to avoid issues on docker build |
| 52 | + && sed -i 's/packages.append("snapcraft")/#packages.append("snapcraft")/g' /setup/install-build-deps.py \ |
| 53 | + && chmod +x /setup/install-build-deps.sh \ |
| 54 | + && chmod +x /setup/install-build-deps.py \ |
| 55 | + && bash /setup/install-build-deps.sh --no-syms --no-prompt --no-chromeos-fonts --no-arm --no-nacl \ |
| 56 | + && rm -rf /var/lib/apt/lists/* |
| 57 | + |
| 58 | +# No Sudo Prompt |
| 59 | +RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \ |
| 60 | + && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep |
| 61 | + |
| 62 | +# Yarn |
| 63 | +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - |
| 64 | +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list |
| 65 | +RUN apt-get update && apt-get install -y yarn |
| 66 | + |
| 67 | +# Node.js |
| 68 | +RUN curl --silent --location https://deb.nodesource.com/setup_16.x | sudo -E bash - |
| 69 | +RUN apt-get update && apt-get install -y nodejs |
| 70 | +RUN npm install -g npm@latest |
| 71 | +RUN npm install -g node-gyp |
| 72 | + |
| 73 | +# Set python3 as default |
| 74 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 |
| 75 | +RUN python --version |
| 76 | + |
| 77 | +# Install docker client |
| 78 | +RUN sudo mkdir -m 0755 -p /etc/apt/keyrings |
| 79 | +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg |
| 80 | +RUN echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
| 81 | +RUN sudo apt-get update && sudo apt-get install -y docker-ce |
| 82 | + |
| 83 | +# Check compiler toolchain |
| 84 | +RUN gcc --version |
| 85 | +RUN g++ --version |
| 86 | + |
| 87 | +# Github action need root user |
| 88 | +# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user |
| 89 | +# USER builduser |
| 90 | +# WORKDIR /home/builduser |
0 commit comments