From 5c4abb6d1d682d600ec6b881b801940108562b99 Mon Sep 17 00:00:00 2001 From: Oleh Formaniuk Date: Sun, 6 Jul 2025 01:47:14 -0700 Subject: [PATCH] [Feature] Add option to expose Docker via TCP port (#5716) --- install/alpine-docker-install.sh | 9 +++++++++ install/docker-install.sh | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/install/alpine-docker-install.sh b/install/alpine-docker-install.sh index 46745d782..1ae4585da 100644 --- a/install/alpine-docker-install.sh +++ b/install/alpine-docker-install.sh @@ -67,5 +67,14 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION" fi +read -r -p "${TAB3}Would you like to expose the Docker TCP socket? " prompt +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + msg_info "Exposing Docker TCP socket" + $STD mkdir -p /etc/docker + $STD echo '{ "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }' > /etc/docker/daemon.json + $STD rc-service docker restart + msg_ok "Exposed Docker TCP socket at tcp://+:2375" +fi + motd_ssh customize diff --git a/install/docker-install.sh b/install/docker-install.sh index 6997225ca..193a947d7 100644 --- a/install/docker-install.sh +++ b/install/docker-install.sh @@ -57,6 +57,15 @@ else fi fi +read -r -p "${TAB3}Would you like to expose the Docker TCP socket? " prompt +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + msg_info "Exposing Docker TCP socket" + $STD mkdir -p /etc/docker + $STD echo '{ "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }' > /etc/docker/daemon.json + $STD rc-service docker restart + msg_ok "Exposed Docker TCP socket at tcp://+:2375" +fi + motd_ssh customize