mirror of
https://github.com/rancher/os-kernel.git
synced 2025-09-28 13:56:00 +00:00
the header and extras image code from the rancher/os repo
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
5
images/10-extras/Dockerfile
Normal file
5
images/10-extras/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM alpine:3.4
|
||||||
|
# FROM arm64=skip arm=skip
|
||||||
|
RUN apk --purge --no-cache add kmod bash openssl
|
||||||
|
COPY extra.sh /usr/bin
|
||||||
|
CMD ["extra.sh"]
|
19
images/10-extras/extra.sh
Executable file
19
images/10-extras/extra.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR=$(readlink /lib/modules/$(uname -r)/build)
|
||||||
|
STAMP=/lib/modules/$(uname -r)/.extra-done
|
||||||
|
VER=$(basename $DIR)
|
||||||
|
URL=${KERNEL_EXTRAS_URL:-https://github.com/rancher/os-kernel/releases/download/${VER}/extra.tar.gz}
|
||||||
|
|
||||||
|
if [ -e $STAMP ]; then
|
||||||
|
echo Kernel extras already installed. Delete $STAMP to reinstall
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Downloading $URL
|
||||||
|
wget -O - $URL | gzip -dc | tar xf - -C /
|
||||||
|
depmod -a
|
||||||
|
touch $STAMP
|
||||||
|
|
||||||
|
echo Kernel extras installed
|
3
images/10-headers/Dockerfile
Normal file
3
images/10-headers/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
FROM rancher/os-base
|
||||||
|
COPY headers.sh /
|
||||||
|
CMD ["/headers.sh"]
|
24
images/10-headers/headers.sh
Executable file
24
images/10-headers/headers.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR=$(readlink /lib/modules/$(uname -r)/build)
|
||||||
|
STAMP=${DIR}/.done
|
||||||
|
VER=$(basename $DIR)
|
||||||
|
|
||||||
|
if [ "$VER" = "Ubuntu-4.4.0-23.41-rancher2" ]; then
|
||||||
|
VER=Ubuntu-4.4.0-23.41-rancher2-2
|
||||||
|
fi
|
||||||
|
|
||||||
|
KERNEL_HEADERS_URL=${KERNEL_HEADERS_URL:-https://github.com/rancher/os-kernel/releases/download/${VER}/build.tar.gz}
|
||||||
|
|
||||||
|
if [ -e $STAMP ]; then
|
||||||
|
echo Headers already installed in $DIR
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Downloading $KERNEL_HEADERS_URL
|
||||||
|
mkdir -p $DIR
|
||||||
|
wget -O - $KERNEL_HEADERS_URL | gzip -dc | tar xf - -C $DIR
|
||||||
|
touch $STAMP
|
||||||
|
|
||||||
|
echo Headers installed at $DIR
|
25
scripts/build-images
Executable file
25
scripts/build-images
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export ARCH=${ARCH:-"amd64"}
|
||||||
|
BASE=images
|
||||||
|
|
||||||
|
source $(dirname $0)/version
|
||||||
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
|
for i in $BASE/[0-9]*; do
|
||||||
|
name="os-$(echo ${i} | cut -f2 -d-)"
|
||||||
|
tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
|
||||||
|
echo Building ${tag}
|
||||||
|
if [ -x ${i}/prebuild.sh ]; then
|
||||||
|
${i}/prebuild.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if dapper -d --build -f ${i}/Dockerfile -- -t rancher/${name} ${i}; then
|
||||||
|
docker tag rancher/${name} ${tag}
|
||||||
|
elif [ "$?" != "42" ]; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "WARN: Skipping ${tag}"
|
||||||
|
fi
|
||||||
|
done
|
Reference in New Issue
Block a user