blob: e11c25d86db4be7ec8b7e155fbb2badfc3afbf29 [file] [log] [blame]
Martin Roth561f3682016-12-30 17:00:19 -07001# This dockerfile is not meant to be used directly by docker. The
2# {{}} varibles are replaced with values by the makefile. Please generate
3# the docker image for this file by running:
4#
5# make coreboot-jenkins-node
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.
12# SSH_KEY is the contents of the file coreboot-jenkins-node/authorized_keys
13# Because we're piping the contents of the dockerfile into the
14# docker build command, the 'COPY' keyword isn't valid.
15
Patrick Georgidd5fe142021-01-27 13:20:43 +010016FROM coreboot/coreboot-sdk:{{SDK_VERSION}} AS zephyr-sdk
17USER root
18RUN wget -O zephyr.run https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.3/zephyr-sdk-0.11.3-setup.run
19RUN chmod +x ./zephyr.run
20RUN ./zephyr.run -- -d /opt/zephyr-sdk
21
Martin Roth561f3682016-12-30 17:00:19 -070022FROM coreboot/coreboot-sdk:{{SDK_VERSION}}
Martin Rothf75d1df2016-05-16 11:27:56 -060023USER root
Martin Roth2d97cb12016-05-16 11:27:56 -060024
Martin Rothf75d1df2016-05-16 11:27:56 -060025RUN apt-get -y update && \
26 apt-get -y install \
Martin Roth1fcf78c2022-02-28 15:20:10 -070027 default-jre-headless \
28 liblua5.3-dev \
29 linkchecker \
30 lua5.3 \
31 meson \
32 ninja-build \
33 openssh-server \
34 parallel \
Martin Rothb3f91b72022-05-23 16:04:38 -060035 ruby-full \
Martin Roth1fcf78c2022-02-28 15:20:10 -070036 sdcc \
37 && apt-get clean
Martin Roth2d97cb12016-05-16 11:27:56 -060038
Martin Roth561f3682016-12-30 17:00:19 -070039# Because of the way that the variables are being replaced, docker's 'COPY'
40# command does not work
41RUN mkdir -p /home/coreboot/.ssh && \
42 echo "{{SSH_KEY}}" > /home/coreboot/.ssh/authorized_keys && \
43 chown -R coreboot:coreboot /home/coreboot/.ssh && \
Martin Roth2d97cb12016-05-16 11:27:56 -060044 chmod 0700 /home/coreboot/.ssh && \
45 chmod 0600 /home/coreboot/.ssh/authorized_keys
46
47RUN mkdir /var/run/sshd && \
Martin Roth561f3682016-12-30 17:00:19 -070048 chmod 0755 /var/run/sshd && \
49 /usr/bin/ssh-keygen -A
Martin Roth2d97cb12016-05-16 11:27:56 -060050
Martin Rotha2662992020-10-25 18:24:34 -060051# Create tmpfs directories to build in
Martin Roth30b7c312018-07-12 21:49:06 -060052RUN mkdir /cb-build && \
53 chown coreboot:coreboot /cb-build && \
Martin Roth2aba15f2020-10-25 18:44:35 -060054 echo "tmpfs /cb-build tmpfs rw,mode=1777,noatime 0 0" > /etc/fstab && \
Martin Rotha2662992020-10-25 18:24:34 -060055 mkdir -p /home/coreboot/node-root/workspace && \
56 chown -R coreboot:coreboot /home/coreboot/node-root && \
Martin Roth2aba15f2020-10-25 18:44:35 -060057 echo "tmpfs /home/coreboot/node-root/workspace tmpfs rw,mode=1777,strictatime,atime 0 0" >> /etc/fstab && \
Martin Roth30b7c312018-07-12 21:49:06 -060058 chown coreboot:coreboot /home/coreboot/.ccache && \
59 echo "tmpfs /home/coreboot/.ccache tmpfs rw,mode=1777 0 0" >> /etc/fstab
60
Martin Roth2d97cb12016-05-16 11:27:56 -060061# Build encapsulate tool
Patrick Georgi34042472020-02-14 09:51:54 +010062ADD https://raw.githubusercontent.com/coreboot/encapsulate/master/encapsulate.c /tmp/encapsulate.c
Martin Roth2d97cb12016-05-16 11:27:56 -060063RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \
64 chown root /usr/sbin/encapsulate && \
65 chmod +s /usr/sbin/encapsulate
66
Patrick Georgidd5fe142021-01-27 13:20:43 +010067COPY --from=zephyr-sdk /opt/zephyr-sdk /opt/zephyr-sdk
68
Patrick Georgi86e9b412021-02-15 16:02:01 +010069RUN apt-get update && \
Martin Roth1fcf78c2022-02-28 15:20:10 -070070 apt-get install -y \
71 python3-pip \
72 pykwalify \
73 python3-yaml \
74 python3-pyelftools \
75 python3-jsonschema \
76 python3-colorama \
77 python3-pyrsistent \
78 python3-setuptools \
79 swig \
Martin Rothb3f91b72022-05-23 16:04:38 -060080 && apt-get clean \
81 && pip3 install --upgrade --no-cache-dir pip \
82 && pip3 install --no-cache-dir \
83 jinja2==3.0.3 \
84 recommonmark===0.5.0 \
85 sphinx===1.8.3 \
86 sphinxcontrib-ditaa===0.6 \
87 sphinx_autobuild===0.7.1 \
88 sphinx_rtd_theme===0.4.2 \
89 && gem install mdl
Patrick Georgi86e9b412021-02-15 16:02:01 +010090
91RUN mkdir /tmp/b && cd /tmp/b && \
92 git clone https://git.kernel.org/pub/scm/utils/dtc/dtc.git dtc && \
93 git clone https://chromium.googlesource.com/chromiumos/third_party/u-boot -b chromeos-v2020.10-rc1 u-boot && \
94 (cd dtc && make install_pylibfdt PREFIX=/usr/local) && \
95 (cd u-boot/tools/dtoc && python3 setup.py install) && \
96 (cd u-boot/tools/patman && python3 setup.py install) && \
97 (cd u-boot/tools/binman && python3 setup.py install) && \
98 cd / && rm -rf /tmp/b
99
Martin Rothf75d1df2016-05-16 11:27:56 -0600100VOLUME /data/cache
Martin Roth30b7c312018-07-12 21:49:06 -0600101ENTRYPOINT mount /cb-build && \
Martin Rotha2662992020-10-25 18:24:34 -0600102 mount /home/coreboot/node-root/workspace && \
103 chown -R coreboot:coreboot /home/coreboot/node-root && \
Martin Roth30b7c312018-07-12 21:49:06 -0600104 mount /home/coreboot/.ccache && \
105 chown coreboot:coreboot /home/coreboot/.ccache && \
106 /usr/sbin/sshd -p 49151 -D
Martin Rothf75d1df2016-05-16 11:27:56 -0600107EXPOSE 49151
108ENV PATH $PATH:/usr/sbin