Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 1 | # 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 | |
| 16 | FROM coreboot/coreboot-sdk:{{SDK_VERSION}} |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 17 | USER root |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 18 | |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 19 | RUN apt-get -y update && \ |
| 20 | apt-get -y install \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 21 | default-jre-headless \ |
Felix Singer | b45b48d | 2022-09-01 11:11:12 +0200 | [diff] [blame] | 22 | libcmocka-dev \ |
Elyes Haouas | 9f59d2a | 2023-01-28 11:16:04 +0100 | [diff] [blame] | 23 | liblua5.4-dev \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 24 | linkchecker \ |
Elyes Haouas | 9f59d2a | 2023-01-28 11:16:04 +0100 | [diff] [blame] | 25 | lua5.4 \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 26 | openssh-server \ |
| 27 | parallel \ |
Martin Roth | b3f91b7 | 2022-05-23 16:04:38 -0600 | [diff] [blame] | 28 | ruby-full \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 29 | sdcc \ |
Felix Singer | 98d7157 | 2023-04-06 02:29:23 +0200 | [diff] [blame] | 30 | python3-pip \ |
| 31 | pykwalify \ |
Martin Roth | 162b648 | 2023-11-10 13:20:18 -0700 | [diff] [blame] | 32 | python3-venv \ |
Felix Singer | 98d7157 | 2023-04-06 02:29:23 +0200 | [diff] [blame] | 33 | python3-yaml \ |
| 34 | python3-pyelftools \ |
| 35 | python3-jsonschema \ |
| 36 | python3-colorama \ |
| 37 | python3-pyrsistent \ |
| 38 | swig \ |
| 39 | && apt-get clean \ |
Felix Singer | 98d7157 | 2023-04-06 02:29:23 +0200 | [diff] [blame] | 40 | && gem install mdl |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 41 | |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 42 | RUN mkdir /var/run/sshd && \ |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 43 | chmod 0755 /var/run/sshd && \ |
| 44 | /usr/bin/ssh-keygen -A |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 45 | |
Martin Roth | a266299 | 2020-10-25 18:24:34 -0600 | [diff] [blame] | 46 | # Create tmpfs directories to build in |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 47 | RUN mkdir /cb-build && \ |
| 48 | chown coreboot:coreboot /cb-build && \ |
Martin Roth | 2aba15f | 2020-10-25 18:44:35 -0600 | [diff] [blame] | 49 | echo "tmpfs /cb-build tmpfs rw,mode=1777,noatime 0 0" > /etc/fstab && \ |
Martin Roth | a266299 | 2020-10-25 18:24:34 -0600 | [diff] [blame] | 50 | mkdir -p /home/coreboot/node-root/workspace && \ |
| 51 | chown -R coreboot:coreboot /home/coreboot/node-root && \ |
Martin Roth | 2aba15f | 2020-10-25 18:44:35 -0600 | [diff] [blame] | 52 | echo "tmpfs /home/coreboot/node-root/workspace tmpfs rw,mode=1777,strictatime,atime 0 0" >> /etc/fstab && \ |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 53 | chown coreboot:coreboot /home/coreboot/.ccache && \ |
| 54 | echo "tmpfs /home/coreboot/.ccache tmpfs rw,mode=1777 0 0" >> /etc/fstab |
| 55 | |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 56 | # Build encapsulate tool |
Martin Roth | dbc33f9 | 2023-11-10 11:51:35 -0700 | [diff] [blame] | 57 | ADD https://raw.githubusercontent.com/coreboot/encapsulate/master/encapsulate.c /tmp/encapsulate.c |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 58 | RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \ |
| 59 | chown root /usr/sbin/encapsulate && \ |
| 60 | chmod +s /usr/sbin/encapsulate |
| 61 | |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 62 | VOLUME /data/cache |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 63 | ENTRYPOINT mount /cb-build && \ |
Martin Roth | a266299 | 2020-10-25 18:24:34 -0600 | [diff] [blame] | 64 | mount /home/coreboot/node-root/workspace && \ |
| 65 | chown -R coreboot:coreboot /home/coreboot/node-root && \ |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 66 | mount /home/coreboot/.ccache && \ |
| 67 | chown coreboot:coreboot /home/coreboot/.ccache && \ |
| 68 | /usr/sbin/sshd -p 49151 -D |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 69 | EXPOSE 49151 |
Martin Roth | 1e193d01 | 2023-07-31 09:33:03 -0600 | [diff] [blame] | 70 | |
| 71 | USER coreboot |
Martin Roth | 162b648 | 2023-11-10 13:20:18 -0700 | [diff] [blame] | 72 | ENV VIRTUAL_ENV="/home/coreboot/python3" |
| 73 | ENV PATH=$VIRTUAL_ENV/bin:$PATH:/home/coreboot/.local/bin |
| 74 | RUN 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 Roth | 1e193d01 | 2023-07-31 09:33:03 -0600 | [diff] [blame] | 79 | setuptools==58.2.0 \ |
Nicholas Chin | 9203e25 | 2024-02-05 13:17:01 -0700 | [diff] [blame] | 80 | jinja2==3.1.3 \ |
Nicholas Chin | 9203e25 | 2024-02-05 13:17:01 -0700 | [diff] [blame] | 81 | myst-parser===2.0.0 \ |
| 82 | sphinx===7.2.6 \ |
Nicholas Chin | 2fe63a1 | 2023-02-22 11:55:22 -0700 | [diff] [blame] | 83 | sphinxcontrib-ditaa===1.0.2 \ |
Nicholas Chin | 9203e25 | 2024-02-05 13:17:01 -0700 | [diff] [blame] | 84 | sphinx_autobuild===2024.2.4 \ |
| 85 | sphinx_rtd_theme===2.0.0 \ |
Martin Roth | 1e193d01 | 2023-07-31 09:33:03 -0600 | [diff] [blame] | 86 | && 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 Roth | 0bb9dcc | 2023-11-15 15:29:04 -0700 | [diff] [blame] | 90 | USER root |