You can use dockerrun script to run Docker container. We only support docker on batch nodes.
This will download a new image (if it is missed), create user and $HOME directory inside a container, mount current directory to /docker_pwd and set is as working directory
$ whoami && ls # to test $ dockerrun centos:7 whoami $ dockerrun centos:7 ls # should produce same output
Some images are stripped so much that they do not have some standard directories and adding user is impossible there. In this case you can use -no-add-user option. This may also be used if you do not want to overwrite /passwd and /group file in your container or you have an entrypoint specified in the image which cannot be overwritten.
$ dockerrun -no-add-user hello-world $ dockerrun -no-add-user centos:7 whoami whoami: cannot find name for user ID ... $ dockerrun -no-add-user centos:7 id # you have no real user there, but all ids and gids are there. ....
3. If you do not need to disable user namespace you can use original Docker commands. But remember that data access will be limited.
$ docker run -it centos:7 whoami root $ docker run -it -v $HOME:/test centos:7 ls /test ls: cannot open directory /test: Permission denied