blob: 86521a11239718e8148679684fc1d06c743d773d [file] [log] [blame]
FROM gcr.io/cloud-builders/git
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 python3.8 \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
# 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
# sh module for python
RUN pip3 install --no-cache-dir -U sh --quiet
# 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
# gcb container setup
RUN mkdir -p /workspace/gcb/bmc
RUN chmod -R 777 /workspace/gcb/bmc
RUN chown build:build -R /workspace/gcb/bmc
USER build