blob: 50ff0daa77925fe92c7c9a8043138de4eb9701c4 [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
16FROM coreboot/coreboot-sdk:{{SDK_VERSION}}
Martin Rothf75d1df2016-05-16 11:27:56 -060017USER root
Martin Roth2d97cb12016-05-16 11:27:56 -060018
Martin Rothf75d1df2016-05-16 11:27:56 -060019RUN apt-get -y update && \
20 apt-get -y install \
Martin Roth1fcf78c2022-02-28 15:20:10 -070021 default-jre-headless \
Felix Singerb45b48d2022-09-01 11:11:12 +020022 libcmocka-dev \
Elyes Haouas9f59d2a2023-01-28 11:16:04 +010023 liblua5.4-dev \
Martin Roth1fcf78c2022-02-28 15:20:10 -070024 linkchecker \
Elyes Haouas9f59d2a2023-01-28 11:16:04 +010025 lua5.4 \
Martin Roth1fcf78c2022-02-28 15:20:10 -070026 meson \
27 ninja-build \
28 openssh-server \
29 parallel \
Martin Rothb3f91b72022-05-23 16:04:38 -060030 ruby-full \
Martin Roth1fcf78c2022-02-28 15:20:10 -070031 sdcc \
Felix Singer98d71572023-04-06 02:29:23 +020032 python3-pip \
33 pykwalify \
34 python3-yaml \
35 python3-pyelftools \
36 python3-jsonschema \
37 python3-colorama \
38 python3-pyrsistent \
39 swig \
40 && apt-get clean \
Felix Singerfa41fef2023-04-09 00:32:39 +020041 && pip3 install --upgrade --no-cache-dir --break-system-packages pip \
42 && pip3 install --no-cache-dir --break-system-packages \
Felix Singer98d71572023-04-06 02:29:23 +020043 setuptools==58.2.0 \
44 jinja2==3.0.3 \
45 recommonmark===0.5.0 \
46 sphinx===1.8.3 \
47 sphinxcontrib-ditaa===0.6 \
48 sphinx_autobuild===0.7.1 \
49 sphinx_rtd_theme===0.4.2 \
50 && gem install mdl
Martin Roth2d97cb12016-05-16 11:27:56 -060051
Martin Roth561f3682016-12-30 17:00:19 -070052# Because of the way that the variables are being replaced, docker's 'COPY'
53# command does not work
54RUN mkdir -p /home/coreboot/.ssh && \
55 echo "{{SSH_KEY}}" > /home/coreboot/.ssh/authorized_keys && \
56 chown -R coreboot:coreboot /home/coreboot/.ssh && \
Martin Roth2d97cb12016-05-16 11:27:56 -060057 chmod 0700 /home/coreboot/.ssh && \
58 chmod 0600 /home/coreboot/.ssh/authorized_keys
59
60RUN mkdir /var/run/sshd && \
Martin Roth561f3682016-12-30 17:00:19 -070061 chmod 0755 /var/run/sshd && \
62 /usr/bin/ssh-keygen -A
Martin Roth2d97cb12016-05-16 11:27:56 -060063
Martin Rotha2662992020-10-25 18:24:34 -060064# Create tmpfs directories to build in
Martin Roth30b7c312018-07-12 21:49:06 -060065RUN mkdir /cb-build && \
66 chown coreboot:coreboot /cb-build && \
Martin Roth2aba15f2020-10-25 18:44:35 -060067 echo "tmpfs /cb-build tmpfs rw,mode=1777,noatime 0 0" > /etc/fstab && \
Martin Rotha2662992020-10-25 18:24:34 -060068 mkdir -p /home/coreboot/node-root/workspace && \
69 chown -R coreboot:coreboot /home/coreboot/node-root && \
Martin Roth2aba15f2020-10-25 18:44:35 -060070 echo "tmpfs /home/coreboot/node-root/workspace tmpfs rw,mode=1777,strictatime,atime 0 0" >> /etc/fstab && \
Martin Roth30b7c312018-07-12 21:49:06 -060071 chown coreboot:coreboot /home/coreboot/.ccache && \
72 echo "tmpfs /home/coreboot/.ccache tmpfs rw,mode=1777 0 0" >> /etc/fstab
73
Martin Roth2d97cb12016-05-16 11:27:56 -060074# Build encapsulate tool
Patrick Georgi34042472020-02-14 09:51:54 +010075ADD https://raw.githubusercontent.com/coreboot/encapsulate/master/encapsulate.c /tmp/encapsulate.c
Martin Roth2d97cb12016-05-16 11:27:56 -060076RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \
77 chown root /usr/sbin/encapsulate && \
78 chmod +s /usr/sbin/encapsulate
79
Martin Rothf75d1df2016-05-16 11:27:56 -060080VOLUME /data/cache
Martin Roth30b7c312018-07-12 21:49:06 -060081ENTRYPOINT mount /cb-build && \
Martin Rotha2662992020-10-25 18:24:34 -060082 mount /home/coreboot/node-root/workspace && \
83 chown -R coreboot:coreboot /home/coreboot/node-root && \
Martin Roth30b7c312018-07-12 21:49:06 -060084 mount /home/coreboot/.ccache && \
85 chown coreboot:coreboot /home/coreboot/.ccache && \
86 /usr/sbin/sshd -p 49151 -D
Martin Rothf75d1df2016-05-16 11:27:56 -060087EXPOSE 49151
88ENV PATH $PATH:/usr/sbin