z/OS Container Extensions: Developers Rejoice!

unsplash-logo
Daniel von Appen

I’ve been experimenting with my shiny new z/OS 2.4 system for a little while now. One of the coolest things that z/OS 2.4 brings to the table is z/OS Container Extensions (IBM zCX). You can fire up one, two or a zillion zCX started tasks, each of which is running a Z Docker server. Ok. not a zillion, but you get the idea…

With Docker in mind, I decided to see how my previous experiment of running the IBM Z Open Automation Utilities remotely from my Mac would work under zCX. After all, Docker is Docker right?

The first thing I needed to do was set up my Docker environment under zCX. Not only did I need an ssh client, but I also needed the experimental code from my git repo. As with the Mac experiment, I first configured ssh so that I could connect from my Docker environment into the enclosing z/OS instance. I put the private/public key in a zoau sub-directory as I did on my Mac.

On to creating my Docker development environment…

I started out with extending Ubuntu and getting the various tools I would need (ssh, git, and vim)

FROM ubuntu:latest
 RUN apt-get update && apt-get install -y \
     vim git ssh-client

As with my previous experiment, I then needed to define what the connection to my server (in this case, the enclosing z/OS instance). This code is identical to what I did with my Mac environment (Docker being Docker after all…)

 ARG priv
 ARG pub
 ARG user
 ARG server
 ARG port
 ARG zosdir

 ENV RMVSDIR="${zosdir}"
 ENV RMVSHOST="${server}"
 ENV RMVSSCP=scp
 ENV RMVSSCPOPTS="-P ${port}"
 ENV RMVSSSH=ssh
 ENV RMVSSSHOPTS="-p ${port}"
 ENV RMVSUSER="${user}"

 # copy credentials in from owning environment
 RUN mkdir /root/.ssh/ && chmod 0700 /root/.ssh
 RUN echo "${priv}" >/root/.ssh/id_rsa
 RUN echo "${pub}" >/root/.ssh/id_rsa.pub
 RUN chmod 600 /root/.ssh/id_rsa
 RUN chmod 600 /root/.ssh/id_rsa.pub
 RUN ssh-keyscan -p ${port} ${server} >/root/.ssh/known_hosts

Now I just needed my experimental remote ZOAU code and to set up my PATH to point to the code

RUN git clone https://github.com/mikefultonbluemix/samples.git
ENV PATH "/samples/rzoau/bin:$PATH"

Putting it all together:

  • build: builds the Docker file into an image
  • run: runs the Docker image in interactive mode, providing a development shell
  • dls “$RMVSUSER.*” runs dls remotely on my enclosing z/OS instance, listing out datasets under my ID.

This is pretty cool. Using only z/OS, I can access my MVS datasets and use my favourite Linux tools all from the IBM zCX environment.


Posted

in

, ,

by

Comments

Leave a comment