[IBMCloud] ROKS上のDebugシェルからのイメージPullの確認(podman)

## 目的
ROKSのWorkerNodeにDebugを実施し、PODからContainerRegistryへのPullが可能か確認
主にPODからContainerRegistryへのネットワークに問題がないか切り分けに利用可能

**作業の流れ**
- Podmanをインストールする
- IBMCloud CLI(Linuxパッケージ)をインストールする
- Container Registryプラグインをインストールする
- IBMCloudにログイン
- IBMCloud CRにログイン
- イメージをPullする

---
## Podmanをインストールする
1.Debugコマンドでノードにログインする
```
% oc debug node/10.244.0.4
Temporary namespace openshift-debug-677fm is created for debugging node...
Starting pod/1024404-debug-c4vf4 ...
To use host binaries, run `chroot /host`
Pod IP: 10.244.0.4
If you don't see a command prompt, try pressing enter.
sh-4.4#
```

2.パッケージの確認
```
sh-4.4# yum list podman
Updating Subscription Management repositories.
Unable to read consumer identity
subscription-manager is operating in container mode.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                       91 MB/s |  76 MB     00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                    92 MB/s |  69 MB     00:00
Red Hat Universal Base Image 8 (RPMs) - BaseOS                                                                             7.8 MB/s | 722 kB     00:00
Red Hat Universal Base Image 8 (RPMs) - AppStream                                                                           33 MB/s | 3.3 MB     00:00
Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder                                                                  2.8 MB/s | 186 kB     00:00
Available Packages
podman.x86_64                                  4:4.9.4-18.module+el8.10.0+22417+2fb00970                                   rhel-8-for-x86_64-appstream-rpms
podman.x86_64                                  4:4.9.4-18.module+el8.10.0+22417+2fb00970                                   ubi-8-appstream-rpms
```
3.podmanのインストール
```
sh-4.4# yum install podman.x86_64
Updating Subscription Management repositories.
Unable to read consumer identity
subscription-manager is operating in container mode.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                       88 kB/s | 4.1 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                    81 kB/s | 4.5 kB     00:00
Dependencies resolved.
===========================================================================================================================================================
 Package                              Architecture    Version                                              Repository                                 Size
===========================================================================================================================================================
Installing:
 podman                               x86_64          4:4.9.4-18.module+el8.10.0+22417+2fb00970            rhel-8-for-x86_64-appstream-rpms           16 M
Installing dependencies:
 conmon                               x86_64          3:2.1.10-1.module+el8.10.0+22417+2fb00970            rhel-8-for-x86_64-appstream-rpms           58 k
 containernetworking-plugins          x86_64          1:1.4.0-5.module+el8.10.0+22417+2fb00970             rhel-8-for-x86_64-appstream-rpms           22 M
 containers-common                    x86_64          2:1-82.module+el8.10.0+22417+2fb00970                rhel-8-for-x86_64-appstream-rpms          143 k
 criu                                 x86_64          3.18-5.module+el8.10.0+22417+2fb00970                rhel-8-for-x86_64-appstream-rpms          564 k
 dnsmasq                              x86_64          2.79-33.el8_10                                       rhel-8-for-x86_64-appstream-rpms          324 k
 fuse-common                          x86_64          3.3.0-19.el8                                         rhel-8-for-x86_64-baseos-rpms              22 k
 fuse-overlayfs                       x86_64          1.13-1.module+el8.10.0+22417+2fb00970                rhel-8-for-x86_64-appstream-rpms           70 k
 fuse3                                x86_64          3.3.0-19.el8                                         rhel-8-for-x86_64-baseos-rpms              55 k
 fuse3-libs                           x86_64          3.3.0-19.el8                                         rhel-8-for-x86_64-baseos-rpms              96 k
 iptables                             x86_64          1.8.5-11.el8_9                                       rhel-8-for-x86_64-baseos-rpms             592 k
 iptables-libs                        x86_64          1.8.5-11.el8_9                                       rhel-8-for-x86_64-baseos-rpms             103 k
 jansson                              x86_64          2.14-1.el8                                           rhel-8-for-x86_64-baseos-rpms              47 k
 kmod                                 x86_64          25-20.el8                                            rhel-8-for-x86_64-baseos-rpms             126 k
 libnet                               x86_64          1.1.6-15.el8                                         rhel-8-for-x86_64-appstream-rpms           67 k
 libnetfilter_conntrack               x86_64          1.0.6-5.el8                                          rhel-8-for-x86_64-baseos-rpms              65 k
 libnfnetlink                         x86_64          1.0.1-13.el8                                         rhel-8-for-x86_64-baseos-rpms              33 k
 libnftnl                             x86_64          1.2.2-3.el8                                          rhel-8-for-x86_64-baseos-rpms              87 k
 libslirp                             x86_64          4.4.0-2.module+el8.10.0+22417+2fb00970               rhel-8-for-x86_64-appstream-rpms           71 k
 nftables                             x86_64          1:1.0.4-4.el8_9                                      rhel-8-for-x86_64-baseos-rpms             381 k
 podman-catatonit                     x86_64          4:4.9.4-18.module+el8.10.0+22417+2fb00970            rhel-8-for-x86_64-appstream-rpms          376 k
 podman-plugins                       x86_64          4:4.9.4-18.module+el8.10.0+22417+2fb00970            rhel-8-for-x86_64-appstream-rpms          1.3 M
 runc                                 x86_64          1:1.1.12-5.module+el8.10.0+22417+2fb00970            rhel-8-for-x86_64-appstream-rpms          3.1 M
 shadow-utils-subid                   x86_64          2:4.6-22.el8                                         rhel-8-for-x86_64-baseos-rpms             113 k
 slirp4netns                          x86_64          1.2.3-1.module+el8.10.0+22417+2fb00970               rhel-8-for-x86_64-appstream-rpms           56 k
Installing weak dependencies:
 podman-gvproxy                       x86_64          4:4.9.4-18.module+el8.10.0+22417+2fb00970            rhel-8-for-x86_64-appstream-rpms          3.9 M
Enabling module streams:
 container-tools                                      rhel8

Transaction Summary
===========================================================================================================================================================
Install  26 Packages

Total download size: 50 M
Installed size: 149 M
Is this ok [y/N]: y
Downloading Packages:
(1/26): jansson-2.14-1.el8.x86_64.rpm                                                                                      833 kB/s |  47 kB     00:00
(2/26): libnetfilter_conntrack-1.0.6-5.el8.x86_64.rpm                                                                      950 kB/s |  65 kB     00:00
(3/26): libnfnetlink-1.0.1-13.el8.x86_64.rpm                                                                               464 kB/s |  33 kB     00:00
(4/26): libnftnl-1.2.2-3.el8.x86_64.rpm                                                                                    2.3 MB/s |  87 kB     00:00
(5/26): iptables-libs-1.8.5-11.el8_9.x86_64.rpm                                                                            2.8 MB/s | 103 kB     00:00
(6/26): iptables-1.8.5-11.el8_9.x86_64.rpm                                                                                  12 MB/s | 592 kB     00:00
(7/26): nftables-1.0.4-4.el8_9.x86_64.rpm                                                                                  8.8 MB/s | 381 kB     00:00
(8/26): fuse-common-3.3.0-19.el8.x86_64.rpm                                                                                700 kB/s |  22 kB     00:00
(9/26): fuse3-3.3.0-19.el8.x86_64.rpm                                                                                      1.7 MB/s |  55 kB     00:00
(10/26): kmod-25-20.el8.x86_64.rpm                                                                                         3.5 MB/s | 126 kB     00:00
(11/26): fuse3-libs-3.3.0-19.el8.x86_64.rpm                                                                                2.4 MB/s |  96 kB     00:00
(12/26): shadow-utils-subid-4.6-22.el8.x86_64.rpm                                                                          3.1 MB/s | 113 kB     00:00
(13/26): libnet-1.1.6-15.el8.x86_64.rpm                                                                                    1.9 MB/s |  67 kB     00:00
(14/26): dnsmasq-2.79-33.el8_10.x86_64.rpm                                                                                 8.0 MB/s | 324 kB     00:00
(15/26): conmon-2.1.10-1.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                         1.8 MB/s |  58 kB     00:00
(16/26): containers-common-1-82.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                  4.3 MB/s | 143 kB     00:00
(17/26): criu-3.18-5.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                              13 MB/s | 564 kB     00:00
(18/26): fuse-overlayfs-1.13-1.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                   2.3 MB/s |  70 kB     00:00
(19/26): libslirp-4.4.0-2.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                        2.3 MB/s |  71 kB     00:00
(20/26): podman-catatonit-4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64.rpm                                               9.5 MB/s | 376 kB     00:00
(21/26): podman-gvproxy-4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                  35 MB/s | 3.9 MB     00:00
(22/26): podman-plugins-4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                  18 MB/s | 1.3 MB     00:00
(23/26): runc-1.1.12-5.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                            28 MB/s | 3.1 MB     00:00
(24/26): podman-4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                          38 MB/s |  16 MB     00:00
(25/26): slirp4netns-1.2.3-1.module+el8.10.0+22417+2fb00970.x86_64.rpm                                                     680 kB/s |  56 kB     00:00
(26/26): containernetworking-plugins-1.4.0-5.module+el8.10.0+22417+2fb00970.x86_64.rpm                                      36 MB/s |  22 MB     00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                       60 MB/s |  50 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                   1/1
  Installing       : fuse3-libs-3.3.0-19.el8.x86_64                                                                                                   1/26
  Running scriptlet: fuse3-libs-3.3.0-19.el8.x86_64                                                                                                   1/26
  Installing       : iptables-libs-1.8.5-11.el8_9.x86_64                                                                                              2/26
  Installing       : libnftnl-1.2.2-3.el8.x86_64                                                                                                      3/26
  Running scriptlet: libnftnl-1.2.2-3.el8.x86_64                                                                                                      3/26
  Installing       : libnfnetlink-1.0.1-13.el8.x86_64                                                                                                 4/26
  Running scriptlet: libnfnetlink-1.0.1-13.el8.x86_64                                                                                                 4/26
  Installing       : libnetfilter_conntrack-1.0.6-5.el8.x86_64                                                                                        5/26
  Running scriptlet: libnetfilter_conntrack-1.0.6-5.el8.x86_64                                                                                        5/26
  Running scriptlet: iptables-1.8.5-11.el8_9.x86_64                                                                                                   6/26
  Installing       : iptables-1.8.5-11.el8_9.x86_64                                                                                                   6/26
  Running scriptlet: iptables-1.8.5-11.el8_9.x86_64                                                                                                   6/26
  Installing       : podman-gvproxy-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                  7/26
  Installing       : libslirp-4.4.0-2.module+el8.10.0+22417+2fb00970.x86_64                                                                           8/26
  Installing       : slirp4netns-1.2.3-1.module+el8.10.0+22417+2fb00970.x86_64                                                                        9/26
  Installing       : containernetworking-plugins-1:1.4.0-5.module+el8.10.0+22417+2fb00970.x86_64                                                     10/26
  Installing       : conmon-3:2.1.10-1.module+el8.10.0+22417+2fb00970.x86_64                                                                         11/26
  Running scriptlet: dnsmasq-2.79-33.el8_10.x86_64                                                                                                   12/26
  Installing       : dnsmasq-2.79-33.el8_10.x86_64                                                                                                   12/26
  Running scriptlet: dnsmasq-2.79-33.el8_10.x86_64                                                                                                   12/26
  Installing       : podman-plugins-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                 13/26
  Installing       : libnet-1.1.6-15.el8.x86_64                                                                                                      14/26
  Running scriptlet: libnet-1.1.6-15.el8.x86_64                                                                                                      14/26
  Installing       : criu-3.18-5.module+el8.10.0+22417+2fb00970.x86_64                                                                               15/26
  Installing       : runc-1:1.1.12-5.module+el8.10.0+22417+2fb00970.x86_64                                                                           16/26
  Installing       : shadow-utils-subid-2:4.6-22.el8.x86_64                                                                                          17/26
  Installing       : kmod-25-20.el8.x86_64                                                                                                           18/26
  Installing       : fuse-common-3.3.0-19.el8.x86_64                                                                                                 19/26
  Installing       : fuse3-3.3.0-19.el8.x86_64                                                                                                       20/26
  Installing       : fuse-overlayfs-1.13-1.module+el8.10.0+22417+2fb00970.x86_64                                                                     21/26
  Running scriptlet: fuse-overlayfs-1.13-1.module+el8.10.0+22417+2fb00970.x86_64                                                                     21/26
  Installing       : containers-common-2:1-82.module+el8.10.0+22417+2fb00970.x86_64                                                                  22/26
  Installing       : jansson-2.14-1.el8.x86_64                                                                                                       23/26
  Installing       : nftables-1:1.0.4-4.el8_9.x86_64                                                                                                 24/26
  Running scriptlet: nftables-1:1.0.4-4.el8_9.x86_64                                                                                                 24/26
  Installing       : podman-catatonit-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                               25/26
  Installing       : podman-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                         26/26
  Running scriptlet: podman-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                         26/26
  Verifying        : libnetfilter_conntrack-1.0.6-5.el8.x86_64                                                                                        1/26
  Verifying        : libnfnetlink-1.0.1-13.el8.x86_64                                                                                                 2/26
  Verifying        : jansson-2.14-1.el8.x86_64                                                                                                        3/26
  Verifying        : libnftnl-1.2.2-3.el8.x86_64                                                                                                      4/26
  Verifying        : iptables-1.8.5-11.el8_9.x86_64                                                                                                   5/26
  Verifying        : iptables-libs-1.8.5-11.el8_9.x86_64                                                                                              6/26
  Verifying        : nftables-1:1.0.4-4.el8_9.x86_64                                                                                                  7/26
  Verifying        : fuse-common-3.3.0-19.el8.x86_64                                                                                                  8/26
  Verifying        : fuse3-3.3.0-19.el8.x86_64                                                                                                        9/26
  Verifying        : fuse3-libs-3.3.0-19.el8.x86_64                                                                                                  10/26
  Verifying        : kmod-25-20.el8.x86_64                                                                                                           11/26
  Verifying        : shadow-utils-subid-2:4.6-22.el8.x86_64                                                                                          12/26
  Verifying        : libnet-1.1.6-15.el8.x86_64                                                                                                      13/26
  Verifying        : dnsmasq-2.79-33.el8_10.x86_64                                                                                                   14/26
  Verifying        : conmon-3:2.1.10-1.module+el8.10.0+22417+2fb00970.x86_64                                                                         15/26
  Verifying        : containernetworking-plugins-1:1.4.0-5.module+el8.10.0+22417+2fb00970.x86_64                                                     16/26
  Verifying        : containers-common-2:1-82.module+el8.10.0+22417+2fb00970.x86_64                                                                  17/26
  Verifying        : criu-3.18-5.module+el8.10.0+22417+2fb00970.x86_64                                                                               18/26
  Verifying        : fuse-overlayfs-1.13-1.module+el8.10.0+22417+2fb00970.x86_64                                                                     19/26
  Verifying        : libslirp-4.4.0-2.module+el8.10.0+22417+2fb00970.x86_64                                                                          20/26
  Verifying        : podman-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                         21/26
  Verifying        : podman-catatonit-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                               22/26
  Verifying        : podman-gvproxy-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                 23/26
  Verifying        : podman-plugins-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64                                                                 24/26
  Verifying        : runc-1:1.1.12-5.module+el8.10.0+22417+2fb00970.x86_64                                                                           25/26
  Verifying        : slirp4netns-1.2.3-1.module+el8.10.0+22417+2fb00970.x86_64                                                                       26/26
Installed products updated.

Installed:
  conmon-3:2.1.10-1.module+el8.10.0+22417+2fb00970.x86_64                 containernetworking-plugins-1:1.4.0-5.module+el8.10.0+22417+2fb00970.x86_64
  containers-common-2:1-82.module+el8.10.0+22417+2fb00970.x86_64          criu-3.18-5.module+el8.10.0+22417+2fb00970.x86_64
  dnsmasq-2.79-33.el8_10.x86_64                                           fuse-common-3.3.0-19.el8.x86_64
  fuse-overlayfs-1.13-1.module+el8.10.0+22417+2fb00970.x86_64             fuse3-3.3.0-19.el8.x86_64
  fuse3-libs-3.3.0-19.el8.x86_64                                          iptables-1.8.5-11.el8_9.x86_64
  iptables-libs-1.8.5-11.el8_9.x86_64                                     jansson-2.14-1.el8.x86_64
  kmod-25-20.el8.x86_64                                                   libnet-1.1.6-15.el8.x86_64
  libnetfilter_conntrack-1.0.6-5.el8.x86_64                               libnfnetlink-1.0.1-13.el8.x86_64
  libnftnl-1.2.2-3.el8.x86_64                                             libslirp-4.4.0-2.module+el8.10.0+22417+2fb00970.x86_64
  nftables-1:1.0.4-4.el8_9.x86_64                                         podman-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64
  podman-catatonit-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64       podman-gvproxy-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64
  podman-plugins-4:4.9.4-18.module+el8.10.0+22417+2fb00970.x86_64         runc-1:1.1.12-5.module+el8.10.0+22417+2fb00970.x86_64
  shadow-utils-subid-2:4.6-22.el8.x86_64                                  slirp4netns-1.2.3-1.module+el8.10.0+22417+2fb00970.x86_64

Complete!
```

4.インストールの確認
```
sh-4.4# yum list podman
Updating Subscription Management repositories.
Unable to read consumer identity
subscription-manager is operating in container mode.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                       97 kB/s | 4.1 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                   109 kB/s | 4.5 kB     00:00
Installed Packages
podman.x86_64                                  4:4.9.4-18.module+el8.10.0+22417+2fb00970                                  @rhel-8-for-x86_64-appstream-rpms

sh-4.4# podman -v
podman version 4.9.4-rhel
```

---
## IBMCloud CLI(Linuxパッケージ)をインストールする
インストール方法は以下を参照
[シェルからのインストール](https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli&locale=ja#shell_install)

1.curlコマンドでダウンロードしてインストール
```
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
```
```
sh-4.4# curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
Current platform is linux64. Downloading corresponding IBM Cloud CLI...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9.9M  100  9.9M    0     0   168M      0 --:--:-- --:--:-- --:--:--  171M
Download complete. Executing installer...
Bluemix_CLI/
Bluemix_CLI/bin/
Bluemix_CLI/bin/ibmcloud
Bluemix_CLI/bin/ibmcloud.sig
Bluemix_CLI/bin/NOTICE
Bluemix_CLI/bin/LICENSE
Bluemix_CLI/autocomplete/
Bluemix_CLI/autocomplete/bash_autocomplete
Bluemix_CLI/autocomplete/zsh_autocomplete
Bluemix_CLI/install
Bluemix_CLI/uninstall
Bluemix_CLI/install_bluemix_cli
Install complete.
```

2.インストール確認
```
sh-4.4# ibmcloud -v
ibmcloud 2.30.0 (30a8eda-2024-11-05T20:52:46+00:00)
Copyright IBM Corp. 2014, 2024
```

---
## Container Registryプラグインをインストールする
インストール方法は下記を参照
[Container Registry CLI のインストール](https://cloud.ibm.com/docs/Registry?topic=Registry-getting-started&locale=ja#gs_registry_cli_install)

1.プラグインのインストール
```
sh-4.4# ibmcloud plugin install container-registry
Looking up 'container-registry' from repository 'IBM Cloud'...
Plug-in 'container-registry[cr] 1.3.12' found in repository 'IBM Cloud'
Attempting to download the binary file...
 0 B / 11.85 MiB [--------------------------------------------------------------------------------------------------------------------------------]   0.00 11.85 MiB / 11.85 MiB [=======================================================================================================================] 100.00% 0s
12423320 bytes downloaded
Installing binary...
OK
Plug-in 'container-registry 1.3.12' was successfully installed into /root/.bluemix/plugins/container-registry. Use 'ibmcloud plugin show container-registry' to show its details.
```

2.インストール確認
```
sh-4.4# ibmcloud plugin show container-registry

Plugin Name                              container-registry[cr]
Plugin Version                           1.3.12
Plugin SDK Version                       1.2.0
Minimal IBM Cloud CLI version required   0.4.2
Private endpoints supported              true

Commands:
 cr                               Manage IBM Cloud Container Registry content and configuration.
 cr info                          Display information about the current IBM Cloud Container Registry command session.
 cr namespace-add                 Add a namespace to your account. You must set at least one namespace to store images in IBM Cloud Container Registry.
 cr namespace-assign              Assign a currently unassigned namespace to the targeted resource group.
 cr namespace-rm                  Delete a namespace from your account, and also delete all images within that namespace.
 cr namespace-list,namespaces     List namespaces for your account.
 cr api                           Display IBM Cloud Container Registry API endpoint.
 cr image-list,images             List your tagged images in IBM Cloud Container Registry.
 cr image-digests,digests         List all your images in IBM Cloud Container Registry by digest.
 cr image-prune-untagged          Delete all your untagged images in IBM Cloud Container Registry
 cr image-rm                      Delete one or more images from IBM Cloud Container Registry.
 cr image-inspect                 Inspect one or more images in IBM Cloud Container Registry.
 cr manifest-inspect              Inspect an image manifest in IBM Cloud Container Registry.
 cr image-tag                     Create a new tag, TARGET_IMAGE, that refers to a source image, SOURCE_IMAGE, in IBM Cloud Container Registry.
 cr image-untag                   Remove tags from one or more images in IBM Cloud Container Registry.
 cr login                         Log the local Docker or Podman client in to IBM Cloud Container Registry.
 cr vulnerability-assessment,va   Display detailed vulnerability assessment reports for one or more images in IBM Cloud Container Registry.
 cr quota                         Display information about your IBM Cloud Container Registry quotas.
 cr quota-set                     Set your storage and traffic quotas for IBM Cloud Container Registry.
 cr plan                          Display information about your IBM Cloud Container Registry pricing plan.
 cr plan-upgrade                  Set your pricing plan for IBM Cloud Container Registry.
 cr region                        Display the targeted region.
 cr region-set                    Set a target region for the IBM Cloud Container Registry commands.
 cr exemption-list,exemptions     List your exemptions for security issues.
 cr exemption-add                 Create an exemption for a security issue. You can create an exemption for a security issue that applies to different scopes. The scope can be the account, namespace, repository, tag, or digest.
 cr exemption-rm                  Delete an exemption for a security issue. To view your existing exemptions, run 'ibmcloud cr exemption-list'.
 cr exemption-types               Lists the types of security issues that you can exempt.
 cr iam-policies-enable           If you are using IAM authentication, this command enables fine-grained authorization.
 cr iam-policies-status           Display whether fine-grained authorization is enabled for your account.
 cr retention-run                 Retains a specified number of images for each repository within a namespace in IBM Cloud Container Registry. All other images in the namespace are deleted.
 cr image-restore                 Restores an image from the trash.
 cr retention-policy-set          Set a scheduled policy to retain a specified number of images for each repository within a namespace in IBM Cloud Container Registry. Policy will run immediately. All other images in the namespace are deleted.
 cr retention-policy-list         List the image retention policies for your account.
 cr trash-list                    List images in the trash and see when they expire.
 cr private-only                  Configure private-only mode. If private-only mode is enabled, you can pull or push container images over private network connections only.
 cr platform-metrics              Configure platform metrics enablement.
 cr va-version                    Display the targeted Vulnerability Advisor version.
 cr va-version-set                Set a target Vulnerability Advisor version for the IBM Cloud Container Registry commands.
```

---
## IBMCloudにログイン
ログインコマンドは以下を参照
[ibmcloud login](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli&locale=ja#ibmcloud_login)
```
sh-4.4# ibmcloud login -a cloud.ibm.com -r jp-tok -g acs-xxx --apikey JHznEBxxxxxxxxxx
API endpoint: https://cloud.ibm.com
Authenticating...
OK

Targeted account xxx's Account (db415c559c0e468cb941xxxxx) <-> 27966xx

Targeted resource group acs-xxx

Targeted region jp-tok


API endpoint:     https://cloud.ibm.com
Region:           jp-tok
User:             K.H@ibm.com
Account:          xxx's Account
(db415c559c0e468cb941xxxxx) <-> 27966xx
Resource group:   acs-xxx
```
---
## IBMCloud CRにログイン
ログインコマンドは以下を参照
[ibmcloud cr login](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregcli&locale=ja#bx_cr_login)
```
sh-4.4# ibmcloud cr login
Logging 'podman' in to 'jp.icr.io'...
Logged in to 'jp.icr.io'.

OK
```
---
## イメージをpullする
ContainerRegistryにあるNginxのイメージをPullする
```
sh-4.4# podman pull jp.icr.io/khoshixx-cr/nginxn
Trying to pull jp.icr.io/khoshixx-cr/nginxn:latest...
Getting image source signatures
Copying blob 39fc875bd2b2 done   |
Copying blob c5cdd1ce752d done   |
Copying blob e78b137be355 done   |
Copying blob 87c3fb37cbf2 done   |
Copying blob 8a1e25ce7c4f done   |
Copying blob 035788421403 done   |
Copying blob 33952c599532 done   |
Copying blob 0add8e08c1b3 done   |
Copying blob a82ec92788cf done   |
Copying blob 193af94a6ca4 done   |
Copying config b3c508d8de done   |
Writing manifest to image destination
b3c508d8de28c6992b4d915b861ded6553ac628ca69a86aa5553b60d92fc7e46
```

Debugセッションを抜けた場合、初期化されるため再度実施する必要がある