-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 1.34 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
FROM registry.fedoraproject.org/fedora-minimal:latest
# Can configure oc and kubectl versions. Default is oc 4.4 with the matching kubectl version
# See https://cloud.ibm.com/docs/openshift?topic=openshift-openshift_versions#version_types
# for more info about Kubernetes version used with specific versions of OpenShift
# OpenShift 4.4 (Default)
ARG OPENSHIFT_VERSION=4.4
ARG KUBECTL_VERSION=1.17.13
# OpenShift 4.5 (Need to provide via --build-arg flags when building)
# docker build ... --build-arg OPENSHIFT_VERSION=4.5 --build-arg KUBECTL_VERSION=1.18.10 ...
# Need tar command
RUN microdnf install -y tar
# Install kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && chmod +x ./kubectl && mv ./kubectl /usr/local/bin/kubectl
# Install ibmcloud cli with openshift plugin
RUN curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
RUN ibmcloud plugin install container-service
# Install oc
RUN curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/oc/${OPENSHIFT_VERSION}/linux/oc.tar.gz && tar -zxf oc.tar.gz
RUN mv ./oc /usr/local/bin/oc && rm oc.tar.gz
# Create a scripts dir for child images to put their scripts
RUN mkdir /scripts
WORKDIR /scripts
# Child scripts will copy their unique scripts to the /scripts folder
COPY scripts/* /scripts/
RUN chmod +x /scripts/*.sh