How Do I Copy Files into an IOx Container?

Debugging IOx containers is difficult because the containers are secured. Even if you are able to login to the container using "ioxclient app con CONTAINER", it's not possible to update files because the filesystem is mounted with attributes to prevent the root from writing to the filesystem. However, it is possible to write to the filesystem from IOx (Linux) by writing to the containers filesystem which is mounted on:

/software/caf/work/repo-lxc/${container}/rootfs_mnt

The files must be owned by root and extracted via tar onto this filesystem. The script below will allow you to copy local files to the container:

$ cat ~/bin/cptoiox
 #!/bin/bash

 if [ $# -lt 5 ]
 then
     port=$1
     ip=$2
     container=$3

     shift 3
     tar cf - --owner=0 --group=0 $* | ssh -p $port -l root $ip 'cat > xfer.tar'
     ssh -p $port -l root $ip "tar xf xfer.tar -C /software/caf/work/repo-lxc/${container}/rootfs_mnt/appdir/app"
 else
    echo $0 port ip container files...
 fi