-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
87 lines (66 loc) · 3.5 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM ubuntu:20.04 as base
ENV DEBIAN_FRONTEND=noninteractive TERM=xterm
RUN echo "export > /etc/envvars" >> /root/.bashrc && \
echo "export PS1='\[\e[1;31m\]\u@\h:\w\\$\[\e[0m\] '" | tee -a /root/.bashrc /etc/skel/.bashrc && \
echo "alias tcurrent='tail /var/log/*/current -f'" | tee -a /root/.bashrc /etc/skel/.bashrc
RUN apt-get update
RUN apt-get install -y locales tzdata && locale-gen en_US.UTF-8 && dpkg-reconfigure locales
ENV LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
# Runit
RUN apt-get install -y --no-install-recommends runit
CMD bash -c 'export > /etc/envvars && /usr/bin/runsvdir /etc/service'
# Utilities
RUN apt-get install -y --no-install-recommends vim less net-tools inetutils-ping wget curl git telnet nmap socat dnsutils netcat tree htop unzip sudo software-properties-common jq psmisc iproute2 python ssh rsync gettext-base
#Proxy needs iptables
RUN apt-get install -y --no-install-recommends iptables conntrack
#ZFS
RUN apt-get install -y --no-install-recommends zfsutils-linux
#NFS client
RUN apt-get install -y --no-install-recommends nfs-common
#XFS
RUN apt-get install -y --no-install-recommends libguestfs-xfs
#Ceph client
RUN apt-get install -y --no-install-recommends ceph-common
#For Hairpin-veth mode
RUN apt-get install -y --no-install-recommends ethtool
#IPVS
RUN apt-get install -y --no-install-recommends ipvsadm ipset
#Consul Template
RUN wget -O - https://releases.hashicorp.com/consul-template/0.20.0/consul-template_0.20.0_linux_amd64.tgz | tar zx -C /usr/local/bin
#Docker client only
RUN wget -O - https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz | tar zx -C /usr/local/bin --strip-components=1 docker/docker
#Dockershim
RUN wget -O - https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.12/cri-dockerd-0.3.12.amd64.tgz | tar zx
#Kubernetes
ARG KUBERNETES_VERSION=v1.29.3
RUN wget -P /usr/local/bin https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubelet
RUN wget -P /usr/local/bin https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kube-proxy
RUN wget -P /usr/local/bin https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl
RUN wget -P /usr/local/bin https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kube-apiserver
RUN wget -P /usr/local/bin https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kube-controller-manager
RUN wget -P /usr/local/bin https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kube-scheduler
RUN chmod +x /usr/local/bin/kube*
#Etcd
RUN wget -O - https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11-linux-amd64.tar.gz | tar zx
RUN mv /etcd* /etcd && \
ln -s /etcd/etcd /usr/local/bin/etcd && \
ln -s /etcd/etcdctl /usr/local/bin/etcdctl
RUN mkdir -p /var/lib/etcd-data
#Addon Manager
COPY --from=gcr.io/google-containers/kube-addon-manager:v9.1.1 /opt/kube-addons.sh /opt/kube-addons.sh
#Vault
RUN wget https://releases.hashicorp.com/vault/1.7.1/vault_1.7.1_linux_amd64.zip && \
unzip vault*.zip && \
rm vault*.zip && \
mv vault /usr/local/bin/
RUN mkdir -p /srv/kubernetes
COPY vault-init.sh /
COPY vault.hcl /
ENV VAULT_ADDR=http://0.0.0.0:8200
COPY consul-template.sh /
COPY bootstrap-tokens.sh /
COPY etc/kubernetes/addons /etc/kubernetes/addons
# Add runit services
COPY sv /etc/service
ARG BUILD_INFO
LABEL BUILD_INFO=$BUILD_INFO