[DOCKER] Install the IBM Cloud CLI in the container

Overview

Install IBM Cloud CLI in the Docker container and build a CLI development environment that does not pollute the local environment. This time we will create a container using the latest CentOS image. As a prerequisite, Docker Desktop is installed.

procedure

Container preparation

Get image of CentOS 8

docker pull centos:latest

Create and start a container from the acquired image

docker run -it -d --name ibmcloud centos:latest

Checking the running container

docker ps

Connect inside the container

docker exec -it <CONTAINER ID> bash

yum update

yum check-update

IBM Cloud CLI installation

The official CLI installation method is here (https://cloud.ibm.com/docs/cli?topic=cli-getting-started)

Install the which command

yum which

See here (https://qiita.com/Masayuki-M/items/6e7d541b1627f55df221) for the reason to install which.

CLI installation

curl -sL https://ibm.biz/idt-installer | bash

Confirm CLI installation

ibmcloud -v

Save container

Make a container an image

docker commit <CONTAINER ID> ibmcloud 

Summary

With the above procedure, you have created a container that can execute the ibmcloud command. The last image save eliminates the need to reinstall the CLI after a reboot.

Recommended Posts

Install the IBM Cloud CLI in the container
AWS CLI install in Ubuntu 20.04
Install the plugin in Eclipse
How to check the logs in the Docker container
How Docker works ~ Implement the container in 60 lines
[Beginner] Install java development tool in cloud9 development environment.
Install Veeam PN on Ubuntu in IBM Cloud VPC and connect with SSL VPN
I was addicted to the NoSuchMethodError in Cloud Endpoints
Deploy Java apps on the IBM Cloud Kubernetes service
[CentOS7] Install aws cli
Automatically start the container
Microservices in Spring Cloud
I tried to develop the cache function of Application Container Cloud Service in the local environment
Copy and paste the file contents in Ubuntu's Docker container
Install by specifying the version of Django in the Docker environment
Install docker and docker-compose on ubuntu in the shortest process
If you just want to run your containers in the cloud, Azure Container Instances is easy