blob: 230842c5300d1542889b000a68dfb1602f3bfa8d [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}}
17MAINTAINER Martin Roth <martin@coreboot.org>
Martin Rothf75d1df2016-05-16 11:27:56 -060018USER root
Martin Roth2d97cb12016-05-16 11:27:56 -060019
20# Check to make sure /dev is a tmpfs file system
21RUN mount | grep "on /dev type tmpfs" > /dev/null || exit 1
22
Martin Rothf75d1df2016-05-16 11:27:56 -060023RUN apt-get -y update && \
24 apt-get -y install \
Martin Roth2d97cb12016-05-16 11:27:56 -060025 lua5.3 liblua5.3-dev openjdk-8-jre-headless openssh-server && \
26 apt-get clean
27
Martin Roth561f3682016-12-30 17:00:19 -070028# Because of the way that the variables are being replaced, docker's 'COPY'
29# command does not work
30RUN mkdir -p /home/coreboot/.ssh && \
31 echo "{{SSH_KEY}}" > /home/coreboot/.ssh/authorized_keys && \
32 chown -R coreboot:coreboot /home/coreboot/.ssh && \
Martin Roth2d97cb12016-05-16 11:27:56 -060033 chmod 0700 /home/coreboot/.ssh && \
34 chmod 0600 /home/coreboot/.ssh/authorized_keys
35
36RUN mkdir /var/run/sshd && \
Martin Roth561f3682016-12-30 17:00:19 -070037 chmod 0755 /var/run/sshd && \
38 /usr/bin/ssh-keygen -A
Martin Roth2d97cb12016-05-16 11:27:56 -060039
40# Build encapsulate tool
41ADD https://raw.githubusercontent.com/pgeorgi/encapsulate/master/encapsulate.c /tmp/encapsulate.c
42RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \
43 chown root /usr/sbin/encapsulate && \
44 chmod +s /usr/sbin/encapsulate
45
Martin Rothf75d1df2016-05-16 11:27:56 -060046VOLUME /data/cache
47ENTRYPOINT mkdir /dev/cb-build && chown coreboot /dev/cb-build && /usr/sbin/sshd -p 49151 -D
48EXPOSE 49151
49ENV PATH $PATH:/usr/sbin