Search code examples
dockerinstallationwebsphereworkflowmainframe

How to copy the docker images to IBM zCX server from USS


I am trying to build z/OSMF workflow to copy my application docker images from USS into zCX server. There are two approaches -

  1. Push docker image to zCX Private/Public docker Registry.
  2. Copy the docker tar to ZCX and load into docker repository using docker load command

I have neither zCX Docker Registry nor a linux system. My docker images are available in tar format on USS. There is no SFTP available in zCX.

  1. Is there any way to get my docker images in zCX?
  2. Is there any z/OSMF built-in step to perform this activity?

I read the documentation - http://www.redbooks.ibm.com/redbooks/pdfs/sg248457.pdf. It is not so clear to get started.


Solution

  • If you have set up zCX, and set up a default userid, then presumably you can ssh from USS env in zOS to the zCX env, with no pwd requried.

    Which means you can do cmd like this to binary transfer a file to zCX

    ZCX @ SC:/tmp>echo 'put /tmp/hw.txt' | sftp -P 8022 admin@cn02.ibm.com:/tmp

    The authenticity of host '[cn02.ibm.com]:8022 ([129.01.01.01]:8022)' can't be established. ECDSA key fingerprint is SHA256:CplCw7We+4b/gOK8ngj9XlY3p6uFNZXRabmvBqu6r3o. Are you sure you want to continue connecting (yes/no)? yes FOTS2274 Warning: Permanently added '[cn02.ibm.com]:8022,[129.01.01.01]:8022' (ECDSA) to the list of known hosts. Connected to cn02.ibm.com. Changing to: /tmp sftp> put /tmp/hw.txt Uploading /tmp/hw.txt to /tmp/hw.txt /tmp/hw.txt 100% 20 0.0KB/s 00:00

    In zCX, when logon:

    admin@cn02:/tmp$ pwd /tmp admin@cn02:/tmp$ ls -lrt total 4 -rwxrwxr-x 1 admin admin 20 May 15 12:37 hw.txt admin@cn02:/tmp$ cat hw.txt ȅ▒▒▒@▒▒▒▒@▒▒▒@z`]admin@cn02:/tmp$

    As SFTP does binary transfer by default, the contents of the hw.txt file which are EBCDIC in USS, have been transferred as is to zCX

    As zCX is ASCII, when you do cat on hw.txt in zCX get unreadable output, since the ASCII env is trying to output data that is EBCDIC

    As you want to transfer a tar file from USS to zCX, you do no want EBCDIC to ASCII conversion to happen, you want sftp to do asis ( binary transfer ) , which is the default