Skip to content

Commit bca1f6d

Browse files
author
Sean Sundberg
committed
v0.2.0-lite - strips down to essentials
1 parent 20c6464 commit bca1f6d

4 files changed

Lines changed: 50 additions & 157 deletions

File tree

Dockerfile

Lines changed: 35 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
FROM docker.io/hashicorp/terraform:0.12.24
2-
3-
ENV TERRAFORM_VERSION 0.12.24
4-
ENV TERRAFORM_IBMCLOUD_VERSION 1.2.6
5-
ENV TERRAFORM_KUBERNETES_VERSION 1.10.0
6-
ENV TERRAFORM_HELM_VERSION 1.0.0
7-
ENV SUPPORTED_CALICO 3.12.0
8-
ENV NVM_VERSION 0.35.2
9-
ENV NODE_VERSION 12
10-
ENV SOLSA_VERSION 0.3.5
1+
FROM docker.io/hashicorp/terraform:0.12.26
2+
3+
ENV TERRAFORM_IBMCLOUD_VERSION 1.6.0
114
ENV KUBECTL_VERSION 1.15.5
125

136
RUN apk add --update-cache \
@@ -20,27 +13,6 @@ RUN apk add --update-cache \
2013
ca-certificates \
2114
&& rm -rf /var/cache/apk/*
2215

23-
##################################
24-
# Calico CLI
25-
##################################
26-
27-
# Kustomize
28-
RUN opsys=linux && \
29-
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
30-
grep browser_download |\
31-
grep $opsys |\
32-
cut -d '"' -f 4 |\
33-
grep /kustomize/v |\
34-
sort | tail -n 1 |\
35-
xargs curl -O -L && \
36-
tar xzf ./kustomize_v*_${opsys}_amd64.tar.gz && \
37-
mv kustomize /usr/local/bin/kustomize && \
38-
chmod +x /usr/local/bin/kustomize
39-
40-
##################################
41-
# Terraform
42-
##################################
43-
4416
WORKDIR $GOPATH/bin
4517

4618
COPY src/bin/* /usr/local/bin/
@@ -50,90 +22,68 @@ COPY src/bin/* /usr/local/bin/
5022
##################################
5123

5224
# Configure sudoers so that sudo can be used without a password
53-
RUN chmod u+w /etc/sudoers && echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
25+
RUN groupadd --force sudo && \
26+
chmod u+w /etc/sudoers && \
27+
echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
5428

5529
ENV HOME /home/devops
5630

5731
# Create devops user
58-
RUN groupadd --force sudo && \
59-
groupadd -g 10000 devops && \
60-
useradd -u 10000 -g 10000 -G sudo,root -d ${HOME} -m devops && \
32+
RUN useradd -u 10000 -g root -G sudo -d ${HOME} -m devops && \
6133
usermod --password $(echo password | openssl passwd -1 -stdin) devops
6234

6335
USER devops
6436
WORKDIR ${HOME}
6537

66-
COPY --chown=devops:devops src/etc/* ${HOME}/etc/
38+
COPY --chown=devops:root src/etc/* ${HOME}/etc/
6739

6840
##################################
6941
# IBM Cloud CLI
7042
##################################
7143

7244
# Install the ibmcloud cli
73-
RUN curl -fsSL https://clis.cloud.ibm.com/install/linux | sh && \
74-
ibmcloud plugin install container-service && \
75-
ibmcloud plugin install container-registry && \
76-
ibmcloud config --check-version=false
77-
78-
RUN mkdir -p ${HOME}/.terraform.d/plugins
79-
WORKDIR ${HOME}/.terraform.d/plugins
45+
#RUN curl -fsSL https://clis.cloud.ibm.com/install/linux | sh && \
46+
# ibmcloud plugin install container-service && \
47+
# ibmcloud plugin install container-registry && \
48+
# ibmcloud config --check-version=false
8049

8150
# Install IBM Cloud Terraform Provider
82-
RUN curl -O -L https://github.com/IBM-Cloud/terraform-provider-ibm/releases/download/v1.2.1/linux_amd64.zip &&\
51+
RUN mkdir -p ${HOME}/.terraform.d/plugins && \
52+
cd ${HOME}/.terraform.d/plugins && \
53+
curl -O -L https://github.com/IBM-Cloud/terraform-provider-ibm/releases/download/v${TERRAFORM_IBMCLOUD_VERSION}/linux_amd64.zip &&\
8354
unzip linux_amd64.zip && \
8455
chmod +x terraform-provider-ibm_* &&\
85-
rm -rf linux_amd64.zip
86-
RUN curl -O -L https://github.com/IBM-Cloud/terraform-provider-ibm/releases/download/v1.2.2/linux_amd64.zip &&\
87-
unzip linux_amd64.zip && \
88-
chmod +x terraform-provider-ibm_* &&\
89-
rm -rf linux_amd64.zip
90-
RUN curl -O -L https://github.com/IBM-Cloud/terraform-provider-ibm/releases/download/v${TERRAFORM_IBMCLOUD_VERSION}/linux_amd64.zip &&\
91-
unzip linux_amd64.zip && \
92-
chmod +x terraform-provider-ibm_* &&\
93-
rm -rf linux_amd64.zip
94-
95-
# Install Kubernetes Terraform Provider
96-
RUN curl -L https://releases.hashicorp.com/terraform-provider-kubernetes/${TERRAFORM_KUBERNETES_VERSION}/terraform-provider-kubernetes_${TERRAFORM_KUBERNETES_VERSION}_linux_amd64.zip --output kube_linux_amd64.zip && \
97-
unzip kube_linux_amd64.zip && \
98-
chmod +x terraform-provider-kubernetes_* && \
99-
rm -rf kube_linux_amd64.zip
100-
101-
# Install Helm Terraform Provider
102-
RUN curl -L https://releases.hashicorp.com/terraform-provider-helm/${TERRAFORM_HELM_VERSION}/terraform-provider-helm_${TERRAFORM_HELM_VERSION}_linux_amd64.zip --output helm_linux_amd64.zip &&\
103-
unzip helm_linux_amd64.zip &&\
104-
chmod +x terraform-provider-helm_* &&\
105-
rm -rf helm_linux_amd64.zip
56+
rm -rf linux_amd64.zip && \
57+
cd -
10658

10759
WORKDIR ${HOME}
10860

109-
COPY src/image-message ./image-message
61+
COPY --chown=devops:root src/image-message ./image-message
11062
RUN cat ./image-message >> ./.bashrc-ni
11163

112-
RUN curl -L https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz --output oc-client.tar.gz && \
113-
tar xzf oc-client.tar.gz && \
114-
sudo mkdir -p /usr/local/fix && \
115-
sudo chmod a+rwx /usr/local/fix && \
116-
sudo cp openshift-origin-client-tools*/oc /usr/local/fix && \
117-
sudo chmod +x /usr/local/fix/oc && \
118-
rm -rf openshift-origin-client-tools* && \
119-
rm oc-client.tar.gz && \
120-
echo '/lib/ld-musl-x86_64.so.1 --library-path /lib /usr/local/fix/oc $@' > ./oc && \
121-
sudo mv ./oc /usr/local/bin && \
122-
sudo chmod +x /usr/local/bin/oc
123-
# echo "alias oc='/lib/ld-musl-x86_64.so.1 --library-path /lib /usr/local/bin/oc'" >> ./.bashrc-ni
124-
64+
#RUN curl -L https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz --output oc-client.tar.gz && \
65+
# tar xzf oc-client.tar.gz && \
66+
# sudo mkdir -p /usr/local/fix && \
67+
# sudo chmod a+rwx /usr/local/fix && \
68+
# sudo cp openshift-origin-client-tools*/oc /usr/local/fix && \
69+
# sudo chmod +x /usr/local/fix/oc && \
70+
# rm -rf openshift-origin-client-tools* && \
71+
# rm oc-client.tar.gz && \
72+
# echo '/lib/ld-musl-x86_64.so.1 --library-path /lib /usr/local/fix/oc $@' > ./oc && \
73+
# sudo mv ./oc /usr/local/bin && \
74+
# sudo chmod +x /usr/local/bin/oc
12575

12676
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
12777
chmod +x ./kubectl && \
12878
sudo mv ./kubectl /usr/local/bin
12979

130-
RUN curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash && \
131-
sudo cp /usr/local/bin/helm /usr/local/bin/helm3
80+
#RUN curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash && \
81+
# sudo cp /usr/local/bin/helm /usr/local/bin/helm3
13282

133-
RUN sudo chown -R devops ${HOME} && sudo chgrp -R 0 ${HOME} && sudo chmod -R g=u ${HOME}
83+
#RUN sudo chown -R devops ${HOME} && sudo chgrp -R 0 ${HOME} && sudo chmod -R g=u ${HOME}
13484

135-
RUN curl -LO https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
136-
chmod a+x jq-linux64 && \
137-
sudo mv jq-linux64 /usr/local/bin/jq
85+
#RUN curl -LO https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
86+
# chmod a+x jq-linux64 && \
87+
# sudo mv jq-linux64 /usr/local/bin/jq
13888

13989
ENTRYPOINT ["/bin/bash", "--init-file", "/home/devops/.bashrc-ni"]

README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,9 @@
33
This repository builds a Docker image whose container is a client for using IBM Cloud.
44
The container includes the following tools:
55
- terraform cli
6-
- terraform plugins:
7-
- terraform-provider-helm
8-
- terraform-provider-kube
9-
- terraform-provider-ibm
10-
- calico cli
11-
- ibmcloud cli
12-
- ibmcloud plugins:
13-
- container-service
14-
- container-registry
15-
- cloud-databases
16-
- docker cli
6+
- IBM Cloud terraform provider
177
- kubectl cli
18-
- kustomize cli
19-
- openshift (oc) cli
20-
- helm cli
218
- git cli
22-
- nvm cli
23-
- node cli
24-
- npm cli
25-
- solsa cli
26-
- yeoman (yo) cli
279

2810
The container also includes the following helper scripts:
2911
- init.sh

config.yaml

Lines changed: 13 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,80 +5,41 @@ metadataTest:
55
entrypoint: ["/bin/bash", "--init-file", "/home/devops/.bashrc-ni"]
66

77
commandTests:
8-
- name: "current user"
9-
command: "whoami"
10-
expectedOutput: ["devops"]
11-
128
- name: "terraform installation"
139
command: "terraform"
1410
args: ["--help"]
1511
expectedOutput: ["Usage: terraform.*"]
1612

17-
- name: "IBM Cloud CLI installation"
18-
command: "ibmcloud"
19-
args: ["--help"]
20-
expectedOutput: ["NAME:\n.*ibmcloud.*"]
21-
22-
- name: "IBM Cloud container-service plugin"
23-
command: "ibmcloud"
24-
args: ["plugin", "list"]
25-
expectedOutput: [".*container-service/kubernetes-service.*"]
26-
27-
- name: "IBM Cloud container-registry plugin"
28-
command: "ibmcloud"
29-
args: ["plugin", "list"]
30-
expectedOutput: [".*container-registry.*"]
31-
3213
- name: "Kubectl CLI installation"
3314
command: "kubectl"
3415
args: ["version", "--client"]
3516
expectedOutput: [".*v1.15.5.*"]
3617

37-
- name: "Helm 3 CLI installation"
38-
command: "helm3"
39-
args: ["version"]
40-
expectedOutput: ["version.BuildInfo{Version:.v3.*"]
18+
- name: "git installation"
19+
command: "git"
20+
args: ["--help"]
21+
expectedOutput: ["usage: git.*"]
4122

42-
- name: "Kustomize CLI installation"
43-
command: "kustomize"
23+
- name: "curl installation"
24+
command: "curl"
4425
args: ["--help"]
45-
expectedOutput: [".*Usage:\n kustomize.*"]
26+
expectedOutput: ["Usage: curl.*"]
4627

47-
- name: "Git installation"
48-
command: "git"
28+
- name: "unzip installation"
29+
command: "unzip"
4930
args: ["--help"]
50-
expectedOutput: ["usage: git.*"]
31+
expectedOutput: ["UnZip.*"]
5132

52-
- name: "OpenShift client installation"
53-
command: "oc"
33+
- name: "bash installation"
34+
command: "bash"
5435
args: ["--help"]
55-
expectedOutput: [".*OpenShift.*"]
36+
expectedOutput: ["GNU bash.*"]
5637

5738
fileExistenceTests:
5839
- name: 'jenkins-config-template.xml'
5940
path: '/home/devops/etc'
6041
shouldExist: true
6142

62-
- name: "terraform-provider-helm.*"
63-
path: "/home/devops/.terraform.d/plugins"
64-
shouldExist: true
65-
66-
- name: "terraform-provider-kubernetes.*"
67-
path: "/home/devops/.terraform.d/plugins"
68-
shouldExist: true
69-
7043
- name: "terraform-provider-ibm.*"
7144
path: "/home/devops/.terraform.d/plugins"
7245
shouldExist: true
73-
74-
- name: 'cluster-pull-secret-apply.sh'
75-
path: '/usr/local/bin'
76-
shouldExist: true
77-
78-
- name: 'setup-namespace-pull-secrets.sh'
79-
path: '/usr/local/bin'
80-
shouldExist: true
81-
82-
- name: 'checkPodRunning.sh'
83-
path: '/usr/local/bin'
84-
shouldExist: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cli-tools",
3-
"version": "0.1.10",
3+
"version": "0.2.0",
44
"org": "ibmgaragecloud",
55
"branch": "lite",
66
"description": "This repository contains a docker image to help setup an IBM Cloud Public development environment.",

0 commit comments

Comments
 (0)