Commit b6389f9a authored by Chris Lishka's avatar Chris Lishka

Add a couple scripts from ngraph/contrib/docker. chown_files.sh solves a file…

Add a couple scripts from ngraph/contrib/docker.  chown_files.sh solves a file permissions problem involving mounted directories in docker images.
parent 48f2cb17
#!/bin/bash
# the docker run commands leave output files with root ownership
# modify the file ownership with the UID of the calling user
if [ -z $MY_UID ];then
MY_UID=`id -u`
fi
if [ -z $MY_GID ];then
MY_GID=`id -g`
fi
if [ -z $MY_ROOT_DIR ];then
MY_ROOT_DIR=/root/ngraph-test
fi
cd $MY_ROOT_DIR
find . -user root > files_to_chown.txt
cat files_to_chown.txt | xargs chown ${MY_UID} ${1}
cat files_to_chown.txt | xargs chgrp ${MY_GID} ${1}
rm files_to_chown.txt
#!/bin/bash
# list active docker containers
echo "Active docker containers..."
docker ps -a
echo
# clean up old docker containers
echo "Removing Exited docker containers..."
docker ps -a | grep Exited | cut -f 1 -d ' ' | xargs docker rm -f ${1}
echo
#list docker images for ngraph
echo "Docker images for ngraph..."
docker images ngraph_*
echo
# clean up docker images no longer in use
echo "Removing docker images for ngraph..."
docker images -qa ngraph_* | xargs docker rmi -f ${1}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment