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 | |
Patrick Georgi | dd5fe14 | 2021-01-27 13:20:43 +0100 | [diff] [blame] | 16 | FROM coreboot/coreboot-sdk:{{SDK_VERSION}} AS zephyr-sdk |
| 17 | USER root |
| 18 | RUN wget -O zephyr.run https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.3/zephyr-sdk-0.11.3-setup.run |
| 19 | RUN chmod +x ./zephyr.run |
| 20 | RUN ./zephyr.run -- -d /opt/zephyr-sdk |
| 21 | |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 22 | FROM coreboot/coreboot-sdk:{{SDK_VERSION}} |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 23 | USER root |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 24 | |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 25 | RUN apt-get -y update && \ |
| 26 | apt-get -y install \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 27 | default-jre-headless \ |
| 28 | liblua5.3-dev \ |
| 29 | linkchecker \ |
| 30 | lua5.3 \ |
| 31 | meson \ |
| 32 | ninja-build \ |
| 33 | openssh-server \ |
| 34 | parallel \ |
Martin Roth | b3f91b7 | 2022-05-23 16:04:38 -0600 | [diff] [blame^] | 35 | ruby-full \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 36 | sdcc \ |
| 37 | && apt-get clean |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 38 | |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 39 | # Because of the way that the variables are being replaced, docker's 'COPY' |
| 40 | # command does not work |
| 41 | RUN mkdir -p /home/coreboot/.ssh && \ |
| 42 | echo "{{SSH_KEY}}" > /home/coreboot/.ssh/authorized_keys && \ |
| 43 | chown -R coreboot:coreboot /home/coreboot/.ssh && \ |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 44 | chmod 0700 /home/coreboot/.ssh && \ |
| 45 | chmod 0600 /home/coreboot/.ssh/authorized_keys |
| 46 | |
| 47 | RUN mkdir /var/run/sshd && \ |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 48 | chmod 0755 /var/run/sshd && \ |
| 49 | /usr/bin/ssh-keygen -A |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 50 | |
Martin Roth | a266299 | 2020-10-25 18:24:34 -0600 | [diff] [blame] | 51 | # Create tmpfs directories to build in |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 52 | RUN mkdir /cb-build && \ |
| 53 | chown coreboot:coreboot /cb-build && \ |
Martin Roth | 2aba15f | 2020-10-25 18:44:35 -0600 | [diff] [blame] | 54 | 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] | 55 | mkdir -p /home/coreboot/node-root/workspace && \ |
| 56 | chown -R coreboot:coreboot /home/coreboot/node-root && \ |
Martin Roth | 2aba15f | 2020-10-25 18:44:35 -0600 | [diff] [blame] | 57 | 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] | 58 | chown coreboot:coreboot /home/coreboot/.ccache && \ |
| 59 | echo "tmpfs /home/coreboot/.ccache tmpfs rw,mode=1777 0 0" >> /etc/fstab |
| 60 | |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 61 | # Build encapsulate tool |
Patrick Georgi | 3404247 | 2020-02-14 09:51:54 +0100 | [diff] [blame] | 62 | 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] | 63 | RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \ |
| 64 | chown root /usr/sbin/encapsulate && \ |
| 65 | chmod +s /usr/sbin/encapsulate |
| 66 | |
Patrick Georgi | dd5fe14 | 2021-01-27 13:20:43 +0100 | [diff] [blame] | 67 | COPY --from=zephyr-sdk /opt/zephyr-sdk /opt/zephyr-sdk |
| 68 | |
Patrick Georgi | 86e9b41 | 2021-02-15 16:02:01 +0100 | [diff] [blame] | 69 | RUN apt-get update && \ |
Martin Roth | 1fcf78c | 2022-02-28 15:20:10 -0700 | [diff] [blame] | 70 | 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 Roth | b3f91b7 | 2022-05-23 16:04:38 -0600 | [diff] [blame^] | 80 | && 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 Georgi | 86e9b41 | 2021-02-15 16:02:01 +0100 | [diff] [blame] | 90 | |
| 91 | RUN 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 Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 100 | VOLUME /data/cache |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 101 | ENTRYPOINT mount /cb-build && \ |
Martin Roth | a266299 | 2020-10-25 18:24:34 -0600 | [diff] [blame] | 102 | mount /home/coreboot/node-root/workspace && \ |
| 103 | chown -R coreboot:coreboot /home/coreboot/node-root && \ |
Martin Roth | 30b7c31 | 2018-07-12 21:49:06 -0600 | [diff] [blame] | 104 | mount /home/coreboot/.ccache && \ |
| 105 | chown coreboot:coreboot /home/coreboot/.ccache && \ |
| 106 | /usr/sbin/sshd -p 49151 -D |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 107 | EXPOSE 49151 |
| 108 | ENV PATH $PATH:/usr/sbin |