blob: 55172f5fa9aa4f92bc2156fa378210cac418de88 [file] [log] [blame]
Martin Roth561f3682016-12-30 17:00:19 -07001# This dockerfile is not meant to be used directly by docker. The
Martin Rothbea2d752017-09-17 17:35:52 -06002# {{}} variables are replaced with values by the makefile. Please generate
Martin Roth561f3682016-12-30 17:00:19 -07003# the docker image for this file by running:
4#
5# make coreboot-sdk
6#
7# Variables can be updated on the make command line or left blank to use
8# the default values set by the makefile.
9#
10# SDK_VERSION is used to name the version of the coreboot sdk to use.
11# Typically, this corresponds to the toolchain version. This
12# is used to identify this docker image.
13# DOCKER_COMMIT is the coreboot Commit-ID to build the toolchain from.
14
Patrick Georgic9e52942021-01-27 12:34:35 +010015FROM debian:sid AS coreboot-sdk
Martin Roth2d97cb12016-05-16 11:27:56 -060016
Martin Rothf75d1df2016-05-16 11:27:56 -060017RUN \
18 useradd -p locked -m coreboot && \
19 apt-get -qq update && \
Martin Rothbea2d752017-09-17 17:35:52 -060020 apt-get -qqy install \
Martin Rothe7d92482017-10-04 20:53:18 -060021 bc \
Martin Rothbea2d752017-09-17 17:35:52 -060022 bison \
Martin Roth93e6bba2021-11-08 07:55:09 -070023 bsdextrautils \
Martin Rothbea2d752017-09-17 17:35:52 -060024 bzip2 \
25 ccache \
26 cmake \
Martin Rothbd8e6dd2020-10-25 15:07:07 -060027 cscope \
Martin Rothbea2d752017-09-17 17:35:52 -060028 curl \
Patrick Rudolphb90c0d92018-04-04 15:54:26 +020029 device-tree-compiler \
Martin Rothbea2d752017-09-17 17:35:52 -060030 dh-autoreconf \
31 diffutils \
Martin Rothbd8e6dd2020-10-25 15:07:07 -060032 exuberant-ctags \
Martin Rothbea2d752017-09-17 17:35:52 -060033 flex \
34 g++ \
35 gawk \
36 gcc \
37 git \
Felix Singer62c62882023-06-25 22:59:38 +020038 gnat \
Wim Vervoorn01bfa532020-02-03 15:59:07 +010039 golang \
Tom Hiller520c8c02022-08-28 19:57:00 -040040 graphicsmagick-imagemagick-compat \
Martin Roth67403ed2018-05-18 21:53:24 -060041 graphviz \
Martin Roth93e6bba2021-11-08 07:55:09 -070042 lcov \
Martin Rothd727fb52019-04-05 09:53:16 -060043 libcrypto++-dev \
Martin Roth92bc8362019-12-23 15:07:03 -070044 libcurl4 \
45 libcurl4-openssl-dev \
Wim Vervoorn01bfa532020-02-03 15:59:07 +010046 libelf-dev \
Martin Rothbea2d752017-09-17 17:35:52 -060047 libfreetype6-dev \
48 libftdi-dev \
Martin Roth215bc532018-01-28 16:13:38 -070049 libftdi1-dev \
Martin Rothbea2d752017-09-17 17:35:52 -060050 libglib2.0-dev \
51 libgmp-dev \
Martin Roth0cbc3522023-01-20 16:58:54 -070052 libgpiod-dev \
Nico Huber885d9632018-08-16 23:11:55 +020053 libjaylink-dev \
Martin Rothbea2d752017-09-17 17:35:52 -060054 liblzma-dev \
55 libncurses5-dev \
56 libpci-dev \
57 libreadline-dev \
Martin Rothd727fb52019-04-05 09:53:16 -060058 libssl-dev \
Martin Rothbea2d752017-09-17 17:35:52 -060059 libusb-1.0-0-dev \
60 libusb-dev \
61 libxml2-dev \
62 libyaml-dev \
63 m4 \
64 make \
Martin Rothbf78d072018-01-22 21:29:06 -070065 msitools \
Piotr Królf57f1312017-10-09 00:46:24 +020066 nasm \
Martin Rothbea2d752017-09-17 17:35:52 -060067 openssl \
Martin Rothbea2d752017-09-17 17:35:52 -060068 patch \
Martin Rothbd8e6dd2020-10-25 15:07:07 -060069 pbzip2 \
Martin Rothbea2d752017-09-17 17:35:52 -060070 pkg-config \
Martin Roth1ba86f62020-09-10 08:59:35 -060071 python3 \
Felix Singeracbdc4d2022-08-20 11:16:05 +020072 qemu-system-arm \
73 qemu-system-misc \
74 qemu-system-ppc \
75 qemu-system-x86 \
Martin Rothbf78d072018-01-22 21:29:06 -070076 rsync \
Martin Rothbea2d752017-09-17 17:35:52 -060077 shellcheck \
Martin Rothbea2d752017-09-17 17:35:52 -060078 unifont \
Martin Rothbea2d752017-09-17 17:35:52 -060079 uuid-dev \
80 vim-common \
81 wget \
82 xz-utils \
83 zlib1g-dev \
Martin Rothb0fe89d2018-09-09 11:14:53 -060084 && apt-get clean \
Felix Singer0fb77402023-01-06 08:02:50 +010085 && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
Martin Rothb0fe89d2018-09-09 11:14:53 -060086 && ln -s /usr/bin/automake /usr/bin/automake-1.15 \
87 && ln -s /usr/bin/aclocal /usr/bin/aclocal-1.15
Martin Roth2d97cb12016-05-16 11:27:56 -060088
89RUN \
Martin Rothebeec5a2020-10-25 15:16:00 -060090 cd /tmp && \
Paul Menzela8843de2017-06-05 12:33:23 +020091 git clone https://review.coreboot.org/coreboot && \
Nico Huberdd477e92018-11-04 16:16:29 +010092 cd coreboot && \
Martin Rothebeec5a2020-10-25 15:16:00 -060093 git checkout {{DOCKER_COMMIT}}; \
Nico Huberdd477e92018-11-04 16:16:29 +010094 if echo {{CROSSGCC_PARAM}} | grep -q ^all; then \
Martin Rothebeec5a2020-10-25 15:16:00 -060095 make -C /tmp/coreboot/util/crossgcc/ build_clang \
Nico Huberdd477e92018-11-04 16:16:29 +010096 BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \
Martin Rothebeec5a2020-10-25 15:16:00 -060097 fi; \
98 make -C /tmp/coreboot/util/crossgcc/ {{CROSSGCC_PARAM}} \
Martin Rothf0eda822017-03-23 16:13:58 -060099 BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \
Martin Rothebeec5a2020-10-25 15:16:00 -0600100 rm -rf /tmp/coreboot
Martin Roth2d97cb12016-05-16 11:27:56 -0600101
102RUN mkdir /home/coreboot/.ccache && \
103 chown coreboot:coreboot /home/coreboot/.ccache && \
104 mkdir /home/coreboot/cb_build && \
Martin Rothbea2d752017-09-17 17:35:52 -0600105 chown coreboot:coreboot /home/coreboot/cb_build && \
106 echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \
107 echo "export SDK_VERSION={{SDK_VERSION}}" >> /home/coreboot/.bashrc && \
108 echo "export SDK_COMMIT={{DOCKER_COMMIT}}" >> /home/coreboot/.bashrc
109
Martin Rothf75d1df2016-05-16 11:27:56 -0600110ENV PATH $PATH:/opt/xgcc/bin
Martin Roth561f3682016-12-30 17:00:19 -0700111ENV SDK_VERSION={{SDK_VERSION}}
112ENV SDK_COMMIT={{DOCKER_COMMIT}}
Martin Rothf75d1df2016-05-16 11:27:56 -0600113USER coreboot
Martin Roth7d520ff2020-10-25 15:19:40 -0600114
Patrick Georgic9e52942021-01-27 12:34:35 +0100115FROM coreboot-sdk
Patrick Georgic9e52942021-01-27 12:34:35 +0100116VOLUME /home/coreboot/.ccache