blob: 51a4b27d63e34bdcc33f1e882309ae62cc2106bd [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 openssh-server \
27 parallel \
Martin Rothb3f91b72022-05-23 16:04:38 -060028 ruby-full \
Martin Roth1fcf78c2022-02-28 15:20:10 -070029 sdcc \
Felix Singer98d71572023-04-06 02:29:23 +020030 python3-pip \
31 pykwalify \
Martin Roth162b6482023-11-10 13:20:18 -070032 python3-venv \
Felix Singer98d71572023-04-06 02:29:23 +020033 python3-yaml \
34 python3-pyelftools \
35 python3-jsonschema \
36 python3-colorama \
37 python3-pyrsistent \
38 swig \
39 && apt-get clean \
Felix Singer98d71572023-04-06 02:29:23 +020040 && gem install mdl
Martin Roth2d97cb12016-05-16 11:27:56 -060041
Martin Roth2d97cb12016-05-16 11:27:56 -060042RUN mkdir /var/run/sshd && \
Martin Roth561f3682016-12-30 17:00:19 -070043 chmod 0755 /var/run/sshd && \
44 /usr/bin/ssh-keygen -A
Martin Roth2d97cb12016-05-16 11:27:56 -060045
Martin Rotha2662992020-10-25 18:24:34 -060046# Create tmpfs directories to build in
Martin Roth30b7c312018-07-12 21:49:06 -060047RUN mkdir /cb-build && \
48 chown coreboot:coreboot /cb-build && \
Martin Roth2aba15f2020-10-25 18:44:35 -060049 echo "tmpfs /cb-build tmpfs rw,mode=1777,noatime 0 0" > /etc/fstab && \
Martin Rotha2662992020-10-25 18:24:34 -060050 mkdir -p /home/coreboot/node-root/workspace && \
51 chown -R coreboot:coreboot /home/coreboot/node-root && \
Martin Roth2aba15f2020-10-25 18:44:35 -060052 echo "tmpfs /home/coreboot/node-root/workspace tmpfs rw,mode=1777,strictatime,atime 0 0" >> /etc/fstab && \
Martin Roth30b7c312018-07-12 21:49:06 -060053 chown coreboot:coreboot /home/coreboot/.ccache && \
54 echo "tmpfs /home/coreboot/.ccache tmpfs rw,mode=1777 0 0" >> /etc/fstab
55
Martin Roth2d97cb12016-05-16 11:27:56 -060056# Build encapsulate tool
Martin Rothdbc33f92023-11-10 11:51:35 -070057ADD https://raw.githubusercontent.com/coreboot/encapsulate/master/encapsulate.c /tmp/encapsulate.c
Martin Roth2d97cb12016-05-16 11:27:56 -060058RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \
59 chown root /usr/sbin/encapsulate && \
60 chmod +s /usr/sbin/encapsulate
61
Martin Rothf75d1df2016-05-16 11:27:56 -060062VOLUME /data/cache
Martin Roth30b7c312018-07-12 21:49:06 -060063ENTRYPOINT mount /cb-build && \
Martin Rotha2662992020-10-25 18:24:34 -060064 mount /home/coreboot/node-root/workspace && \
65 chown -R coreboot:coreboot /home/coreboot/node-root && \
Martin Roth30b7c312018-07-12 21:49:06 -060066 mount /home/coreboot/.ccache && \
67 chown coreboot:coreboot /home/coreboot/.ccache && \
68 /usr/sbin/sshd -p 49151 -D
Martin Rothf75d1df2016-05-16 11:27:56 -060069EXPOSE 49151
Martin Roth1e193d012023-07-31 09:33:03 -060070
71USER coreboot
Martin Roth162b6482023-11-10 13:20:18 -070072ENV VIRTUAL_ENV="/home/coreboot/python3"
73ENV PATH=$VIRTUAL_ENV/bin:$PATH:/home/coreboot/.local/bin
74RUN echo 'export PATH=$PATH:/opt/xgcc/bin' >> /home/coreboot/.bashrc && \
75 echo "source ${VIRTUAL_ENV}/bin/activate" >> /home/coreboot/.bashrc && \
76 python3 -m venv /home/coreboot/python3 && \
77 pip3 install --upgrade --no-cache-dir pip && \
78 pip3 install --no-cache-dir \
Martin Roth1e193d012023-07-31 09:33:03 -060079 setuptools==58.2.0 \
Nicholas Chin9203e252024-02-05 13:17:01 -070080 jinja2==3.1.3 \
Nicholas Chin9203e252024-02-05 13:17:01 -070081 myst-parser===2.0.0 \
82 sphinx===7.2.6 \
Nicholas Chin2fe63a12023-02-22 11:55:22 -070083 sphinxcontrib-ditaa===1.0.2 \
Nicholas Chin9203e252024-02-05 13:17:01 -070084 sphinx_autobuild===2024.2.4 \
85 sphinx_rtd_theme===2.0.0 \
Martin Roth1e193d012023-07-31 09:33:03 -060086 && mkdir -p /home/coreboot/.ssh && \
87 echo "{{SSH_KEY}}" > /home/coreboot/.ssh/authorized_keys && \
88 chmod 0700 /home/coreboot/.ssh && \
89 chmod 0600 /home/coreboot/.ssh/authorized_keys
Martin Roth0bb9dcc2023-11-15 15:29:04 -070090USER root