CMD Commands For Deploying An Application
CMD Commands For Deploying An Application
Step 1: Copy paste this command on your windows Powershell or search on browser
ibmcloud CLI download and open the docs there you find the download command for
windows.
iex (New-Object
Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell')
Note: After installation restart the system
Microsoft Windows [Version 10.0.22631.4037]
(c) Microsoft Corporation. All rights reserved.
Step 2: Now login in IBM Cloud by using your credentials
Click on the right section named as “avatar” then click on “login with CLI and API” then copy
the command which is written below the “IBM Cloud CLI” and paste on the CMD
C:\Users\abhis>ibmcloud login -a https://cloud.ibm.com -u passcode -p 10SwFI9js9
API endpoint: https://cloud.ibm.com
Authenticating...
OK
Targeted account Abhishek Pandey's Account (53397c95b1284a86947feb1ed4feb8c5)
Select a region (or press enter to skip):
1. au-syd
2. in-che
3. jp-osa
4. jp-tok
5. eu-de
6. eu-es
7. eu-gb
8. ca-tor
9. us-south
10. us-east
11. br-sao
Enter a number> 5 (“enter any number”)
Targeted region eu-de
API endpoint: https://cloud.ibm.com
Region: eu-de
User: abhishek.ibmce@gmail.com
Account: Abhishek Pandey's Account (53397c95b1284a86947feb1ed4feb8c5)
Resource group: No resource group targeted, use 'ibmcloud target -g RESOURCE_GROUP'
Step 3: Set the target group by paste this command “ibmcloud target -g Default”
C:\Users\abhis>ibmcloud target -g Default
Targeted resource group Default
API endpoint: https://cloud.ibm.com
Region: eu-de
User: abhishek.ibmce@gmail.com
Account: Abhishek Pandey's Account (53397c95b1284a86947feb1ed4feb8c5)
Resource group: Default
Step 4: Install Container Service by this command “ibmcloud plugin install container-
service”
C:\Users\abhis>ibmcloud plugin install container-service
Looking up 'container-service' from repository 'IBM Cloud'...
Plug-in 'container-service[kubernetes-service/ks] 1.0.652' found in repository 'IBM Cloud'
Plug-in 'container-service[kubernetes-service/ks] 1.0.638' was already installed. Do you want
to update it with 'container-service[kubernetes-service/ks] 1.0.652' or not? [y/N] > y
Attempting to download the binary file...
30.23 MiB / 30.23 MiB
[==========================================================================
========] 100.00% 13s
31694336 bytes downloaded
Installing binary...
OK
Plug-in 'container-service 1.0.652' was successfully installed into
C:\Users\abhis\.bluemix\plugins\container-service. Use 'ibmcloud plugin show container-
service' to show its details.
Step 5: Install the container registry by this command “ibmcloud plugin install container-
registry”
C:\Users\abhis>ibmcloud plugin install container-registry
Looking up 'container-registry' from repository 'IBM Cloud'...
Plug-in 'container-registry[cr] 1.3.10' found in repository 'IBM Cloud'
Plug-in 'container-registry[cr] 1.3.10' was already installed. Do you want to re-install it or
not? [y/N] > y
Attempting to download the binary file...
12.28 MiB / 12.28 MiB
[==========================================================================
=========] 100.00% 7s
12871680 bytes downloaded
Installing binary...
OK
Plug-in 'container-registry 1.3.10' was successfully installed into
C:\Users\abhis\.bluemix\plugins\container-registry. Use 'ibmcloud plugin show container-
registry' to show its details.
Step 6: Set the region by this command “ibmcloud cr region-set eu-central”
C:\Users\abhis>ibmcloud cr region-set eu-central
The region is set to 'eu-central', the registry is 'de.icr.io'.
OK
Step 7: Set the namespace by this command “ibmcloud cr namespace-add cont-sec8”
(Note you can write anything after sec)
C:\Users\abhis>ibmcloud cr namespace-add cont-sec8
Adding namespace 'cont-sec8' in resource group 'Default' for account Abhishek Pandey's
Account in registry de.icr.io...
Successfully added namespace 'cont-sec8'
OK
Step 8: CR login by this command “ibmcloud cr login”
C:\Users\abhis>ibmcloud cr login
Logging 'docker' in to 'de.icr.io'...
Logged in to 'de.icr.io'.
OK
Step 9: Now check the docker images by this command “docker images” (Note: Docker
Desktop must be running on the background)
C:\Users\abhis>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ibmce 1.0 9c71c236a447 6 days ago 95.6MB
aman 1.0 563cc5f33a96 3 weeks ago 95.6MB
ibme0 1.0 563cc5f33a96 3 weeks ago 95.6MB
ibmeimage 1.0 563cc5f33a96 3 weeks ago 95.6MB
pandey latest c1891bc8989c 3 weeks ago 95.6MB
de.icr.io/cont-sec1/pandey-os latest c1891bc8989c 3 weeks ago 95.6MB
de.icr.io/cont-sec6/abhishek 1.0 fbf478e543ae 5 weeks ago 95.6MB
abhishek 1.0 fbf478e543ae 5 weeks ago 95.6MB
de.icr.io/cont-sec5/alpine-os latest 324bc02ae123 5 weeks ago 7.8MB
de.icr.io/cont-sec5/alpine latest 324bc02ae123 5 weeks ago 7.8MB
alpine latest 324bc02ae123 5 weeks ago 7.8MB
node latest 743c6c23d6f7 5 weeks ago 1.11GB
docker/welcome-to-docker latest c1f619b6477e 9 months ago 18.6MB
webgoat/webgoat-7.1 latest 20fef7540300 7 years ago 460MB
OK
C:\Users\abhis>