Merge pull request #5 from LeonZhang77/verify-ports
Check Ports, only 2 ports allowed where one is always 2222
This commit is contained in:
Коммит
4b16593dfc
|
@ -13,6 +13,14 @@ test_Dockerfile(){
|
|||
cat inspect.json
|
||||
|
||||
# Check SSH Ports
|
||||
# Only 2 ports allowed where one is always 2222
|
||||
testPORTS=$(jq .[].Config.ExposedPorts inspect.json | grep -o ":" | wc -w)
|
||||
if [ ${testPORTS} -gt 2 ]; then
|
||||
echo "${testPORTS}"
|
||||
echo "FAILED - Too many ports are exposed!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
testSSH=$(jq .[].Config.ExposedPorts inspect.json | grep 2222)
|
||||
if [ -z "${testSSH}" ]; then
|
||||
echo "FAILED - PORT 2222 isn't opened, SSH isn't working!!!"
|
||||
|
|
Загрузка…
Ссылка в новой задаче