#
# spec-sw Dockerfile ubuntu 18.04
#
#

# Pull base image.
FROM ubuntu:18.04

# Install.
RUN \
	apt-get update &&\
	apt-get upgrade -y &&\
	apt-get install -y git \
	build-essential \
	linux-headers-4.15.0-47-generic \
	linux-headers-4.18.0-17-generic

# Clone repository and detach HEAD
RUN \
	git clone https://ohwr.org/project/spec-sw.git &&\
	cd spec-sw &&\
	git checkout 36f70fe4

#set enviroment variable for kernel version 4.15.0-47-generic
ENV LINUX /lib/modules/4.15.0-47-generic/build

#construction spec-sw for kerner version 4.15.0-47-generic
RUN \
	cd spec-sw &&\
	make &&\
	make install

#set enviroment variable for kernel version 4.18.0-17-generic
ENV LINUX /lib/modules/4.18.0-17-generic/build

#construction spec-sw for kernel version 4.18.0-17-generic
RUN \
	cd spec-sw &&\
	make clean &&\
	make &&\
	make install

# Define default command.
CMD ["bash"]
