Skip to content

Commit f85feb2

Browse files
committed
[Feature] Add option to expose Docker via TCP port
1 parent 301a23e commit f85feb2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

install/alpine-docker-install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,14 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
6767
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
6868
fi
6969

70+
read -r -p "${TAB3}Would you like to expose the Docker TCP socket? <y/N> " prompt
71+
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
72+
msg_info "Exposing Docker TCP socket"
73+
$STD mkdir -p /etc/docker
74+
$STD echo '{ "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }' > /etc/docker/daemon.json
75+
$STD rc-service docker restart
76+
msg_ok "Exposed Docker TCP socket"
77+
fi
78+
7079
motd_ssh
7180
customize

install/docker-install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ else
5757
fi
5858
fi
5959

60+
read -r -p "${TAB3}Would you like to expose the Docker TCP socket? <y/N> " prompt
61+
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
62+
msg_info "Exposing Docker TCP socket"
63+
$STD mkdir -p /etc/docker
64+
$STD echo '{ "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }' > /etc/docker/daemon.json
65+
$STD rc-service docker restart
66+
msg_ok "Exposed Docker TCP socket"
67+
fi
68+
6069
motd_ssh
6170
customize
6271

0 commit comments

Comments
 (0)