Skip to content

Instantly share code, notes, and snippets.

@ken-zheng
Last active October 11, 2019 19:07
Show Gist options
  • Save ken-zheng/437ae1351b9019fc077073701f3960ee to your computer and use it in GitHub Desktop.
Save ken-zheng/437ae1351b9019fc077073701f3960ee to your computer and use it in GitHub Desktop.
Hyperkube image build with RHEL7 minimal
# syntax = docker/dockerfile:experimental
FROM BASEIMAGE
# Copy the hyperkube binary
COPY hyperkube /hyperkube
RUN --mount=type=bind,source=secrets,target=/run/secrets \
ln -s /hyperkube /apiserver \
&& ln -s /hyperkube /cloud-controller-manager \
&& ln -s /hyperkube /controller-manager \
&& ln -s /hyperkube /kubectl \
&& ln -s /hyperkube /kubelet \
&& ln -s /hyperkube /proxy \
&& ln -s /hyperkube /scheduler \
&& ln -s /hyperkube /usr/local/bin/cloud-controller-manager \
&& ln -s /hyperkube /usr/local/bin/kube-apiserver \
&& ln -s /hyperkube /usr/local/bin/kube-controller-manager \
&& ln -s /hyperkube /usr/local/bin/kube-proxy \
&& ln -s /hyperkube /usr/local/bin/kube-scheduler \
&& ln -s /hyperkube /usr/local/bin/kubectl \
&& ln -s /hyperkube /usr/local/bin/kubelet \
&& echo CACHEBUST>/dev/null && \
microdnf clean all && \
microdnf install --enablerepo rhel-7-server-rpms --nodocs \
hostname \
elfutils-libs \
ca-certificates \
ceph-common \
nfs-utils \
cifs-utils \
conntrack \
e2fsprogs \
xfsprogs \
ebtables \
ethtool \
git \
glusterfs-client \
iptables \
ipset \
kmod \
openssh-clients \
socat \
util-linux && \
rpm -ihv http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-5.9.5-3.el7.x86_64.rpm http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/j/jq-1.5-1.el7.x8
6_64.rpm && \
microdnf clean all && \
rm -rf /var/cache/yum/*
COPY cni-bin/bin /opt/cni/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment