Repository navigation
Expand file tree
/
Copy pathdkstart
More file actions
executable file
·89 lines (77 loc) · 1.78 KB
/
Copy pathdkstart
File metadata and controls
executable file
·89 lines (77 loc) · 1.78 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
################################################################################
#
# dkstart
#
# Start multiple Docker containers and immediately follow logs of the last
# container in the list. Support starting 10 containers at once.
#
# Usage:
# ./dkstart <container1> [container2] [container2] ... [container10]
#
# Example:
# ./dkstart mariadb nginx
# This will start containers named mariadb, nginx, then follow nginx logs.
#
# MIT License.
# Copyright (C) 2025 Nguyen Nhat Tung.
#
################################################################################
if [ ! -z "${1}" ]; then
docker container start ${1}
fi
if [ ! -z "${2}" ]; then
docker container start ${2}
else
docker logs --timestamps --tail 100 --follow ${1}
return 0
fi
if [ ! -z "${3}" ]; then
docker container start ${3}
else
docker logs --timestamps --tail 100 --follow ${2}
return 0
fi
if [ ! -z "${4}" ]; then
docker container start ${4}
else
docker logs --timestamps --tail 100 --follow ${3}
return 0
fi
if [ ! -z "${5}" ]; then
docker container start ${5}
else
docker logs --timestamps --tail 100 --follow ${4}
return 0
fi
if [ ! -z "${6}" ]; then
docker container start ${6}
else
docker logs --timestamps --tail 100 --follow ${5}
return 0
fi
if [ ! -z "${7}" ]; then
docker container start ${7}
else
docker logs --timestamps --tail 100 --follow ${6}
return 0
fi
if [ ! -z "${8}" ]; then
docker container start ${8}
else
docker logs --timestamps --tail 100 --follow ${7}
return 0
fi
if [ ! -z "${9}" ]; then
docker container start ${9}
else
docker logs --timestamps --tail 100 --follow ${8}
return 0
fi
if [ ! -z "${10}" ]; then
docker container start ${10}
else
docker logs --timestamps --tail 100 --follow ${9}
return 0
fi
docker logs --timestamps --tail 100 --follow ${10}