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.
docker pull centos:latest
docker run -it -d --name ibmcloud centos:latest
docker ps
docker exec -it <CONTAINER ID> bash
yum check-update
The official CLI installation method is here (https://cloud.ibm.com/docs/cli?topic=cli-getting-started)
which
commandyum which
See here (https://qiita.com/Masayuki-M/items/6e7d541b1627f55df221) for the reason to install which.
curl -sL https://ibm.biz/idt-installer | bash
ibmcloud -v
Make a container an image
docker commit <CONTAINER ID> ibmcloud
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