-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell
More file actions
executable file
·35 lines (27 loc) · 1005 Bytes
/
shell
File metadata and controls
executable file
·35 lines (27 loc) · 1005 Bytes
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
35
#!/bin/bash
export USER_UID=$(id -u)
export USER_GID=$(id -g)
case "$1" in
list) docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}" $2;;
start) docker-compose up $2 ;;
stop) docker-compose down $2 ;;
restart) docker-compose restart $2 ;;
rebuild) docker-compose build $2 ;;
exec) $DOCKER_EXEC_PREFIX docker-compose exec app sh $2 ;;
*)
echo "Usage: sh shell [COMMANDS] [FLAGS]"
echo ""
echo "Aliases for docker-compose."
echo ""
echo "Commands:"
echo " list List of running containers."
echo " start Up all containers."
echo " -d - run containers in background."
echo " --build - build containers before running."
echo " stop Down all containers."
echo " restart Restart all containers."
echo " rebuild Rebuild all containers."
echo " --no-cache - rebuild containers without cache."
echo ""
;;
esac