Node Problem Detector Image

This ps is to create a new image for NPD in openstack-helm-images
repo using the Ubuntu base instead of Debian, since the upstream Debian
image has some security vulnerabilities
The upstream Docker Image: k8s.gcr.io/node-problem-detector:v0.8.2

Change-Id: I532922a4d678665d184f9eab6fce1a1ce2d1000d
This commit is contained in:
Pai Radhika
2020-06-29 22:30:04 +00:00
parent da3e1bea7e
commit f1948f99cc
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
FROM docker.io/ubuntu:bionic
ARG NPD_VERSION="v0.8.2"
ARG NPD_SRC_URL="https://github.com/kubernetes/node-problem-detector/releases/download/${NPD_VERSION}"
RUN apt-get update ;\
apt-get upgrade -y ;\
apt-get install --no-install-recommends -y wget ca-certificates ;\
#Create a Temp dir to download and extract the package
TMP_DIR=$(mktemp --directory) ;\
wget -q ${NPD_SRC_URL}/node-problem-detector-${NPD_VERSION}.tar.gz -O ${TMP_DIR}/node-problem-detector-${NPD_VERSION}.tar.gz ;\
mkdir -p /opt/node-problem-detector/ ;\
tar zxf ${TMP_DIR}/node-problem-detector-${NPD_VERSION}.tar.gz -C /opt/node-problem-detector ;\
#Cleanup the directories
apt-get autoremove --purge ca-certificates ;\
apt-get clean ;\
rm -rf /var/lib/apt/lists/* /root/.cache ;\
rm -rf ${TMP_DIR}

17
node-problem-detector/build.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
SCRIPT=`realpath $0`
SCRIPT_DIR=`dirname ${SCRIPT}`
## Only build from main folder
cd ${SCRIPT_DIR}/..
IMAGE="node-problem-detector"
VERSION=${VERSION:-latest}
DISTRO=${DISTRO:-ubuntu_bionic}
REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"}
EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""}
NPD_VERSION=${NPD_VERSION:-v0.8.2}
docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE}
cd -