xref: /aosp_15_r20/external/coreboot/util/docker/coreboot-sdk/Dockerfile (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1# Generate the docker image for this file by running:
2#
3#   make coreboot-sdk
4
5FROM debian:stable AS coreboot-sdk
6
7# The coreboot Commit-ID to build the toolchain from.
8ARG DOCKER_COMMIT
9# The version of the coreboot sdk to use. Typically, this corresponds to the
10# toolchain version. This is used to identify this docker image.
11ARG SDK_VERSION
12ARG CROSSGCC_PARAM
13
14RUN \
15	useradd -p locked -m coreboot && \
16	apt-get -qq update && \
17	apt-get -y install --no-install-recommends \
18		bash-completion \
19		bc \
20		bison \
21		bsdextrautils \
22		bzip2 \
23		ca-certificates \
24		ccache \
25		cmake \
26		cscope \
27		curl \
28		device-tree-compiler \
29		dh-autoreconf \
30		diffutils \
31		exuberant-ctags \
32		flex \
33		g++ \
34		gawk \
35		gcc \
36		git \
37		gnat \
38		golang \
39		graphicsmagick-imagemagick-compat \
40		graphviz \
41		lcov \
42		less \
43		libcapture-tiny-perl \
44		libcrypto++-dev \
45		libcurl4-openssl-dev \
46		libdatetime-perl \
47		libelf-dev \
48		libfreetype-dev \
49		libftdi1-dev \
50		libglib2.0-dev \
51		libgmp-dev \
52		libgpiod-dev \
53		libjaylink-dev \
54		liblzma-dev \
55		libnss3-dev \
56		libncurses-dev \
57		libpci-dev \
58		libreadline-dev \
59		libssl-dev \
60		libtimedate-perl \
61		libusb-1.0-0-dev \
62		libxml2-dev \
63		libyaml-dev \
64		make \
65		meson \
66		msitools \
67		neovim \
68		ninja-build \
69		openssh-client \
70		openssl \
71		parted \
72		patch \
73		pbzip2 \
74		pkgconf \
75		python3 \
76		python-is-python3 \
77		qemu-system-arm \
78		qemu-system-misc \
79		qemu-system-ppc \
80		qemu-system-x86 \
81		rsync \
82		sharutils \
83		shellcheck \
84		unifont \
85		unzip \
86		uuid-dev \
87		vim-common \
88		wget \
89		xz-utils \
90		zlib1g-dev \
91	&& apt-get clean
92
93RUN \
94	cd /tmp && \
95	git clone https://review.coreboot.org/coreboot && \
96	cd coreboot && \
97	git checkout ${DOCKER_COMMIT}; \
98	if echo ${CROSSGCC_PARAM} | grep -q ^all; then \
99		make -C /tmp/coreboot/util/crossgcc/ build_clang \
100			BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \
101	fi; \
102	make -C /tmp/coreboot/util/crossgcc/ ${CROSSGCC_PARAM} \
103		BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \
104	rm -rf /tmp/coreboot
105
106RUN mkdir /home/coreboot/.ccache && \
107	chown coreboot:coreboot /home/coreboot/.ccache && \
108	mkdir /home/coreboot/cb_build && \
109	chown coreboot:coreboot /home/coreboot/cb_build && \
110	echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \
111	echo "export SDK_VERSION=${SDK_VERSION}" >> /home/coreboot/.bashrc && \
112	echo "export SDK_COMMIT=${DOCKER_COMMIT}" >> /home/coreboot/.bashrc
113
114ENV PATH $PATH:/opt/xgcc/bin
115ENV SDK_VERSION=${SDK_VERSION}
116ENV SDK_COMMIT=${DOCKER_COMMIT}
117USER coreboot
118
119FROM coreboot-sdk
120VOLUME /home/coreboot/.ccache
121