blob: 1c714b3c96787c951913afa3a749f7ea2a69173f [file] [log] [blame]
FROM ubuntu:18.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get -y install gawk wget git-core \
diffstat unzip texinfo gcc-multilib build-essential \
file chrpath socat cpio python python3-dev python3-pip python3-setuptools \
python3-pexpect xz-utils debianutils iputils-ping curl \
libsdl1.2-dev xterm tar sudo locales liblz4-tool zstd \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
# Create a non-root user that will perform the actual build
RUN id build 2>/dev/null || useradd --uid 30000 --create-home build
RUN echo "build ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers
# Fix error "Please use a locale setting which supports utf-8."
# See https://wiki.yoctoproject.org/wiki/TipsAndTricks/ResolvingLocaleIssues
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Fast gsutil rsync
RUN pip3 install --no-cache-dir -U crcmod
# Python dependencies through pip3
RUN pip3 install --no-cache-dir -U sh
# go/kokoro-cloud-build#docker-container-setup
RUN mkdir -p /tmpfs && mkdir -p /workspace && ln -s /workspace /tmpfs/src
RUN mkdir -p /workspace/gcb/bmc
RUN chmod -R 777 /workspace/gcb/bmc
RUN chown build:build -R /workspace/gcb/bmc
USER build