Skip to content

Commit 45f0e02

Browse files
author
mirko
committed
Socat added
1 parent 46617e0 commit 45f0e02

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN \
1515
logrotate \
1616
nano \
1717
netcat-openbsd \
18+
socat \
1819
sudo && \
1920
echo "**** install openssh-server ****" && \
2021
if [ -z ${OPENSSH_RELEASE+x} ]; then \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
SOCAT_ENABLED=${SOCAT_ENABLED:-false}
5+
SOCAT_LISTEN_PORT=${SOCAT_LISTEN_PORT:-43388}
6+
SOCAT_TARGET_HOST=${SOCAT_TARGET_HOST:-localhost}
7+
SOCAT_TARGET_PORT=${SOCAT_TARGET_PORT:-43389}
8+
SOCAT_Log_Level=${SOCAT_LOG_LEVEL:--ddd}
9+
10+
if [[ "${SOCAT_ENABLED}" != "true" ]]; then
11+
echo "Socat service disabled. Set SOCAT_ENABLED=true to enable."
12+
exec sleep infinity
13+
fi
14+
15+
echo "Starting socat forwarding: LISTEN:${SOCAT_LISTEN_PORT} -> ${SOCAT_TARGET_HOST}:${SOCAT_TARGET_PORT}"
16+
exec /usr/bin/socat ${SOCAT_Log_Level} \
17+
TCP-LISTEN:${SOCAT_LISTEN_PORT},fork,reuseaddr \
18+
TCP4:${SOCAT_TARGET_HOST}:${SOCAT_TARGET_PORT}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun

root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-socat

Whitespace-only changes.

0 commit comments

Comments
 (0)