-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.centos8
110 lines (101 loc) · 5.72 KB
/
Dockerfile.centos8
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
FROM ghcr.io/getupcloud/managed-cluster-base:v1.5.64
ENV \
DOCTL_VERSION="1.63.1" \
FLUX_VERSIONS="v0.15.3" \
GOOGLE_APPLICATION_CREDENTIALS="${CLUSTER_DIR}/service-account.json" \
HCL2JSON_VERSION="v0.3.3" \
KIND_VERSION="v0.11.1" \
KREW_PLUGINS="access-matrix deprecations explore get-all kurt kvaps/node-shell lineage modify-secret outdated score sniff tree" \
KREW_REPOS="kvaps@https://github.com/kvaps/krew-index" \
KREW_VERSION="v0.4.2" \
KREW_ROOT="/opt/krew" \
KUBECONFIG="${CLUSTER_DIR}/.kube/config" \
KUBECTL_VERSIONS="v1.18.18 v1.19.10 v1.20.6 v1.21.0" \
OC_VERSION="4.11.0-0.okd-2022-12-02-145640" \
OSH="/etc/oh-my-bash" \
TERRAFORM_VERSION="1.0.9" \
TF_DATA_DIR="${CLUSTER_DIR}/.terraform" \
TF_IN_AUTOMATION="true" \
TF_LOG="INFO" \
TF_LOG_PROVIDER="INFO" \
TF_LOG_CORE="WARN" \
TF_LOG_PATH="${CLUSTER_DIR}/terraform.log" \
TF_PLAN_FILE="${CLUSTER_DIR}/terraform.tfplan" \
TF_VARS_FILE="${CLUSTER_DIR}/terraform.tfvars" \
VELERO_VERSION="1.6.2" \
PATH="$PATH:$KREW_ROOT/bin"
RUN cd /usr/local/bin && \
curl -skLO https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
rm -f terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
curl -skL https://github.com/mikefarah/yq/releases/download/v4.13.2/yq_linux_amd64 > yq && \
KERNEL_MACHINE=$(uname | tr '[:upper:]' '[:lower:]')-$(uname -m | sed -e 's/x86_64/amd64/' -e 's/arm.*$/arm/' -e 's/aarch64/arm64/') && \
curl -skL https://kind.sigs.k8s.io/dl/v0.11.1/kind-${KERNEL_MACHINE} > kind && \
curl -skL https://github.com/tmccombs/hcl2json/releases/download/v0.3.4/hcl2json_linux_amd64 > hcl2json && \
curl -skL https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.5.9/aws-iam-authenticator_0.5.9_linux_amd64 > \
aws-iam-authenticator && \
curl -skL https://github.com/derailed/k9s/releases/download/v0.24.14/k9s_Linux_x86_64.tar.gz | tar xzvf - k9s && \
curl -skL https://github.com/ahmetb/kubectx/releases/download/v0.9.3/kubectx > kubectx && \
curl -skL https://github.com/ahmetb/kubectx/releases/download/v0.9.3/kubens > kubens && \
curl -sKl https://raw.githubusercontent.com/ahmetb/kubectl-aliases/master/.kubectl_aliases > /etc/profile.d/kubectl_aliases.sh && \
curl -skL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash && \
curl -skL https://run.linkerd.io/install | INSTALLROOT=/usr/local bash && \
curl -skL https://github.com/openshift/okd/releases/download/${OC_VERSION}/openshift-client-linux-${OC_VERSION}.tar.gz \
| tar xzvf - oc && \
for KUBECTL_VERSION in $KUBECTL_VERSIONS; do \
curl -skL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl > \
kubectl_${KUBECTL_VERSION}; \
done && \
ln -s kubectl_$KUBECTL_VERSION kubectl && \
ln -s ${KUBECONFIG%/*} /root/.kube && \
for FLUX_VERSION in $FLUX_VERSIONS; do \
curl -skL https://github.com/fluxcd/flux2/releases/download/${FLUX_VERSION}/flux_${FLUX_VERSION:1}_linux_amd64.tar.gz \
| tar xzv --transform="s,.*,flux-$FLUX_VERSION,"; \
done && \
ln -s flux-$FLUX_VERSION flux && \
curl -skL https://github.com/digitalocean/doctl/releases/download/v$DOCTL_VERSION/doctl-$DOCTL_VERSION-linux-amd64.tar.gz \
| tar xzv doctl && \
curl -skL https://github.com/vmware-tanzu/velero/releases/download/v${VELERO_VERSION}/velero-v${VELERO_VERSION}-linux-amd64.tar.gz \
| tar xzv --strip-components=1 velero-v${VELERO_VERSION}-linux-amd64/velero && \
curl -Lv https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > sops && \
\
curl -skL https://raw.github.com/ohmybash/oh-my-bash/master/tools/install.sh > oh-my-bash.install && \
chmod +x oh-my-bash.install && \
echo "Execute 'oh-my-bash.install' to install OH-MY-BASH" && \
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash && \
curl -kL https://gist.github.com/caruccio/3fe4cb8949419b093c5c5c9b3ac33631/raw/97915ca848e6e5689868c9fa00c3412479e2f9c3/kubectl-extract \
-o /usr/local/bin/kubectl-extract && \
chmod +x /usr/local/bin/kubectl-extract && \
chmod -R +x /usr/local/bin
RUN KERNEL_MACHINE=$(uname | tr '[:upper:]' '[:lower:]')_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/arm.*$/arm/' -e 's/aarch64/arm64/') && \
curl -skL https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew-${KERNEL_MACHINE}.tar.gz \
| tar xzv ./krew-${KERNEL_MACHINE} && \
mv krew-${KERNEL_MACHINE} /usr/local/bin/krew && \
krew install krew && \
ln -s /usr/local/bin/krew /usr/local/bin/kubectl-krew && \
for repo in ${KREW_REPOS}; do \
kubectl krew index add ${repo%%@*} ${repo##*@}; \
done && \
for plugin in ${KREW_PLUGINS}; do \
kubectl krew install $plugin; \
done && \
chmod -R 777 $KREW_ROOT
RUN cd /etc/profile.d && \
curl -skL https://raw.githubusercontent.com/jonmosco/kube-ps1/master/kube-ps1.sh > bash_ps1_kubernetes.sh && \
chmod +x bash_ps1_kubernetes.sh && \
curl -skL https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh > bash_ps1_git.sh && \
chmod +x bash_ps1_git.sh
COPY root/ /
COPY root/etc/skel/ /root/
COPY Dockerfile.* /
ARG GIT_COMMIT
ARG VERSION
ARG RELEASE
RUN echo $VERSION > /.version && \
echo $RELEASE > /.release && \
echo $GIT_COMMIT > /.gitcommit && \
rsync /etc/skel/ /root/ && \
chmod -R +x /etc/profile.d/ && \
chmod 777 /usr/share
WORKDIR $CLUSTER_DIR
ENTRYPOINT ["/usr/local/bin/entrypoint"]