Jim Tang | 4b54e1b | 2019-10-15 17:03:28 +0800 | [diff] [blame] | 1 | # Copyright 2019, The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | FROM ubuntu:latest |
| 16 | ARG UID |
| 17 | ARG USER |
| 18 | ARG SRCTOP |
| 19 | ENV IS_CONTAINER=true |
| 20 | ENV USER=${USER} |
| 21 | |
| 22 | # Installing AOSP essential packages and creating the local user. |
| 23 | # The UID inside and outside must be the same. |
| 24 | RUN useradd -mu ${UID} ${USER} && \ |
Jim Tang | 4b54e1b | 2019-10-15 17:03:28 +0800 | [diff] [blame] | 25 | export DEBIAN_FRONTEND=noninteractive && \ |
| 26 | apt-get update -qq && apt-get install -y \ |
| 27 | git-core \ |
| 28 | gnupg \ |
| 29 | flex \ |
| 30 | bison \ |
| 31 | gperf \ |
| 32 | build-essential \ |
| 33 | zip \ |
| 34 | unzip \ |
| 35 | curl \ |
| 36 | zlib1g-dev \ |
| 37 | gcc-multilib \ |
| 38 | g++-multilib \ |
| 39 | libc6-dev-i386 \ |
| 40 | lib32ncurses5-dev \ |
| 41 | x11proto-core-dev \ |
| 42 | libx11-dev \ |
| 43 | lib32z-dev \ |
| 44 | libgl1-mesa-dev \ |
| 45 | libxml2-utils \ |
| 46 | tzdata \ |
| 47 | python-dev \ |
| 48 | python3-dev \ |
Jim Tang | db963c3 | 2020-08-10 23:16:22 +0800 | [diff] [blame] | 49 | xsltproc \ |
| 50 | sudo |
Jim Tang | 4b54e1b | 2019-10-15 17:03:28 +0800 | [diff] [blame] | 51 | |
| 52 | # Configuring tzdata noninteractively |
Jim Tang | 30627f5 | 2022-01-25 10:35:49 +0800 | [diff] [blame] | 53 | RUN dpkg-reconfigure -f noninteractive tzdata && \ |
| 54 | echo "${USER} ALL=(ALL:ALL)NOPASSWD: ALL" > /etc/sudoers.d/${USER} && \ |
| 55 | mkdir ${SRCTOP} && chown -R ${USER} ${SRCTOP} |
| 56 | RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo && chmod +x /bin/repo |
Jim Tang | 4b54e1b | 2019-10-15 17:03:28 +0800 | [diff] [blame] | 57 | ENV LANG=C.UTF-8 |
| 58 | |
Jim Tang | 4b54e1b | 2019-10-15 17:03:28 +0800 | [diff] [blame] | 59 | USER ${USER} |
| 60 | WORKDIR ${SRCTOP} |