Clean and reorganize some utility scripts
This commit is contained in:
@@ -1 +0,0 @@
|
||||
lxc-attach -n `docker ps --no-trunc | grep $1: | cut -d' ' -f1`
|
||||
5
bin/make
5
bin/make
@@ -1,4 +1 @@
|
||||
DIR=`pwd`
|
||||
cd /opt/docker/images/$1/
|
||||
make $2
|
||||
cd $DIR
|
||||
make -f $DOCKER_HOME/images/$1.mk $2
|
||||
|
||||
32
bin/run
32
bin/run
@@ -1,31 +1 @@
|
||||
#!/bin/bash
|
||||
# Arguments:
|
||||
# $1 = redirected ? -t : <image>
|
||||
# $2 = redirected ? <image> : <mode>
|
||||
# $3 = redirected ? <options> : <command>
|
||||
# When redirected:
|
||||
# $4 = <mode>
|
||||
# $5 = <command>
|
||||
if [ -n "$1" ] && [ $1 == "-t" ]; then
|
||||
HOST_ADDR=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'`
|
||||
PARAMS="--rm -e HOST_ADDR=$HOST_ADDR $3 --name $2"
|
||||
if [ -n "$4" ] && [ $4 == "-i" ]; then
|
||||
# Run without services, provide shell
|
||||
docker run $PARAMS -i -t $2 bash
|
||||
elif [ -n "$4" ] && [ $4 == "-x" ]; then
|
||||
# Run with services, provide shell
|
||||
docker run $PARAMS -i -t $2 /opt/init -- bash -l
|
||||
elif [ -n "$4" ] && [ $4 == "-c" ] && [ -n "$5" ]; then
|
||||
# Run with services, provide shell
|
||||
docker run $PARAMS -i -t $2 /opt/init -- $5
|
||||
elif [ -n "$4" ] && [ $4 == "-w" ]; then
|
||||
# Run without services
|
||||
docker run $PARAMS $2
|
||||
else
|
||||
# Run with services
|
||||
docker run $PARAMS $2 /opt/init
|
||||
fi
|
||||
else
|
||||
/opt/docker/bin/clean # > /dev/null 2>&1
|
||||
/opt/docker/images/$1/bin/run $2 $3
|
||||
fi
|
||||
docker run -it $1 /bin/bash
|
||||
|
||||
Reference in New Issue
Block a user