Wednesday, 30 August 2017

Tinkering with IBM Containers on IBM Bluemix - Like Docker really ...

As per previous posts, I have been tinkering with IBM Containers (IC) on IBM Bluemix, and am starting to bring things together in my mind, in terms of positioning IC vs. Kubernetes vs. Docker.

One of the many things that I like is the amount of help and choices that one has.

Having initialised the Bluemix ( bc ) Cloud Foundry ( cf ) IBM Containers ( ic ) environment: -

bx cf ic init

Invoking 'cf ic init'...

Deleting old configuration file...
OK
Generating client certificates for IBM Containers...
Client certificates are being stored in /Users/foobar/.ice/certs/...

Client certificates are being stored in /Users/foobar/.ice/certs/containers-api.eu-gb.bluemix.net/21377cbf-6e5f-4a9a-175a-4fdfeb3c3e12...

OK
Client certificates were retrieved.

Checking local Docker configuration...
OK

Authenticating with registry at host name registry.eu-gb.bluemix.net
OK
You are authenticated with IBM Bluemix Container Registry.
Your private Bluemix repository is URL: registry.eu-gb.bluemix.net/foobar
No ic-cfg.ini found on the system. Creating...

You can choose from two ways to use the Docker CLI with IBM Containers:


Option 1: This option allows you to use 'cf ic' for managing containers on IBM Containers while still using the Docker CLI directly to manage your local Docker host.
Use this Cloud Foundry IBM Containers plug-in without affecting the local Docker environment:


Example Usage:
cf ic ps
cf ic images

Option 2: Use the Docker CLI directly. In this shell, override the local Docker environment to connect to IBM Containers by setting these variables. Copy and paste the following commands:
Note: Only Docker commands followed by (Docker) are supported with this option. 
  export DOCKER_HOST=tcp://containers-api.eu-gb.bluemix.net:8443
  export DOCKER_CERT_PATH=/Users/foobar/.ice/certs/containers-api.eu-gb.bluemix.net/21377cbf-6e5f-4a9a-175a-4fdfeb3c3e12
  export DOCKER_TLS_VERIFY=1

Example Usage:
docker ps
docker images



it's great to see that I can use either cf ic commands: -

cf ic ps

CONTAINER ID        IMAGE                                                       COMMAND             CREATED             STATUS              PORTS                            NAMES
3cf533af-c95        registry.eu-gb.bluemix.net/foobar/db2expressc:pamfixed   "db2start "         8 days ago          Running             134.168.59.83:50000->50000/tcp   db2


cf ic images

REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE
registry.eu-gb.bluemix.net/ibmnode                       v1.2                b1667ce7e5af        2 weeks ago         183MB
registry.eu-gb.bluemix.net/ibmnode                       v1.1                18f8f073b62b        2 weeks ago         176MB
registry.eu-gb.bluemix.net/ibm-websphere-extreme-scale   latest              8fccb460321a        7 weeks ago         466MB
registry.eu-gb.bluemix.net/ibm-integration-bus           latest              4b5f5fb39008        4 weeks ago         698MB
registry.eu-gb.bluemix.net/ibm_wa_agent                  latest              db7dc2abff64        4 months ago        435MB
registry.eu-gb.bluemix.net/ibm-mq                        latest              b42d55b53b18        8 days ago          455MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile7         cd826253309d        7 weeks ago         268MB
registry.eu-gb.bluemix.net/ibmnode                       v4                  20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibmnode                       latest              20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibm-backup-restore            latest              ea90ec45b636        4 weeks ago         205MB
registry.eu-gb.bluemix.net/ibm-node-strong-pm            latest              9499f23eb689        4 months ago        281MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile6         b350d9fd08fd        7 weeks ago         260MB
registry.eu-gb.bluemix.net/ibmliberty                    latest              edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    javaee7             edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    microProfile        4a50d0f49c6e        7 weeks ago         230MB
registry.eu-gb.bluemix.net/foobar/db2expressc         pamfixed            968890871f71        8 days ago          640MB

 -OR- docker commands: -

docker ps

CONTAINER ID        IMAGE                                                       COMMAND             CREATED             STATUS              PORTS                            NAMES
3cf533af-c95        registry.eu-gb.bluemix.net/foobar/db2expressc:pamfixed   "db2start "         8 days ago          Running             134.168.59.83:50000->50000/tcp   db2


docker images

REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE
registry.eu-gb.bluemix.net/ibm-integration-bus           latest              4b5f5fb39008        4 weeks ago         698MB
registry.eu-gb.bluemix.net/ibm_wa_agent                  latest              db7dc2abff64        4 months ago        435MB
registry.eu-gb.bluemix.net/ibm-websphere-extreme-scale   latest              8fccb460321a        7 weeks ago         466MB
registry.eu-gb.bluemix.net/ibm-mq                        latest              b42d55b53b18        8 days ago          455MB
registry.eu-gb.bluemix.net/ibm-node-strong-pm            latest              9499f23eb689        4 months ago        281MB
registry.eu-gb.bluemix.net/ibmnode                       latest              20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibmnode                       v4                  20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibmnode                       v1.1                18f8f073b62b        2 weeks ago         176MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile7         cd826253309d        7 weeks ago         268MB
registry.eu-gb.bluemix.net/ibmliberty                    microProfile        4a50d0f49c6e        7 weeks ago         230MB
registry.eu-gb.bluemix.net/ibmliberty                    latest              edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    javaee7             edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile6         b350d9fd08fd        7 weeks ago         260MB
registry.eu-gb.bluemix.net/ibm-backup-restore            latest              ea90ec45b636        4 weeks ago         205MB
registry.eu-gb.bluemix.net/ibmnode                       v1.2                b1667ce7e5af        2 weeks ago         183MB
registry.eu-gb.bluemix.net/foobar/db2expressc         pamfixed            968890871f71        8 days ago          640MB

You have a choice - and choices are good :-)

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...