-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_container.sh
executable file
·34 lines (29 loc) · 1.48 KB
/
run_container.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# **************************************************************************** #
# #
# ::: :::::::: #
# run_container.sh :+: :+: :+: #
# +:+ +:+ +:+ #
# By: fbellott <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/09/20 11:49:30 by fbellott #+# #+# #
# Updated: 2016/09/26 15:17:17 by fbellott ### ########.fr #
# #
# **************************************************************************** #
dir=/Users/Shared
container_name='sails'
#container_name=$1
#if [ $# -le 0 ]; then
# echo 'Usage: '$0' <image_name> <dir_to_copy>'
# exit 1
#fi
if [ $# -ge 2 ] && [ ! -d $dir/Server ]; then
cp -r $2 $dir/Server &&
chmod 700 $dir/Server &&
echo $2' was copied to '$dir'/Server. Remeber to delete it ! ;]'
fi
if [ "`docker ps | grep '1337'`" == '' ]; then
docker run -p 1337:1337 -it --add-host="localhost:192.168.99.100" -v /Users/Shared/Server:/root/Server $container_name /bin/bash
else
docker run -it --add-host="localhost:192.168.99.100" -v /Users/Shared/Server:/root/Server $container_name /bin/bash
fi
exit 0