-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
59 lines (48 loc) · 1.87 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM python:3.10-buster
ARG UID=1001
ARG GID=1001
# Make bash the default shell
ENV SHELL=/bin/bash
# Install packages
RUN apt-get clean
RUN apt-get update
RUN apt-get upgrade -y
# software-properties for add-apt-repository
# locales for LANG support
# sudo to make life easier when running as build user
# vim.tiny so we have an editor
RUN apt-get install -y --no-install-recommends \
software-properties-common locales locales-all sudo vim.tiny
# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
# The package sets are based on Yocto & crosstool-ng docs/references:
#
# Yocto:
# https://www.yoctoproject.org/docs/2.3.4/ref-manual/ref-manual.html#ubuntu-packages
#
# crosstool-ng:
# https://github.com/crosstool-ng/crosstool-ng/blob/master/testing/docker/ubuntu18.04/Dockerfile
RUN apt-get install -y --no-install-recommends \
gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 \
xz-utils unzip patch libstdc++6 diffstat build-essential chrpath \
socat cpio python python3 python3-pip python3-pexpect \
python3-setuptools debianutils iputils-ping ca-certificates \
ninja-build
# Install packages for creating SDK packages
RUN apt-get install -y --no-install-recommends makeself p7zip-full tree curl
# Install python packages to allow upload to aws S3
RUN pip3 install awscli
# Install meson to allow building picolibc
RUN pip3 install meson
# Add build-agent user
RUN groupadd -g $GID -o build-agent && \
useradd -u $UID -m -g build-agent build-agent --shell /bin/bash && \
echo 'build-agent ALL = NOPASSWD: ALL' > /etc/sudoers.d/build-agent && \
chmod 0440 /etc/sudoers.d/build-agent
# NOTE: Do not switch to a non-root user because this creates all sorts of
# permission-related problems with the GitHub Actions runner.
# USER build-agent