# spec-sw Dockerfile ubuntu 16.04
#
#

# Pull base image.
FROM ubuntu:16.04

# Install.
RUN \
	apt-get update &&\
	apt-get upgrade -y &&\
	apt-get install -y git \
	build-essential \
	linux-headers-4.4.0-21-generic \
	linux-headers-4.8.0-34-generic \
	linux-headers-4.10.0-14-generic \
	linux-headers-4.13.0-16-generic \
	linux-headers-4.15.0-13-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.4.0-21-generic
ENV LINUX /lib/modules/4.4.0-21-generic/build

#construction spec-sw for kernel version 4.4.0-21-generic
RUN \
	cd spec-sw &&\
	make &&\
	make install

#set enviroment variable for kernel version 4.8.0-34-generic
ENV LINUX /lib/modules/4.8.0-34-generic/build

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

#set enviroment variable for kernel version 4.10.0-14-generic
ENV LINUX /lib/modules/4.10.0-14-generic/build

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

#set enviroment variable for kernel version 4.13.0-16-generic
ENV LINUX /lib/modules/4.13.0-16-generic/build

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

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

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

# Define default command.
CMD ["bash"]
