FROM ghcr.io/linuxserver/baseimage-alpine:3.18 # Install SSH client RUN \ apk add --no-cache \ openssh-client # Set volume for ssh key VOLUME /root/.ssh/id_rsa # Set default values for SSH tunnel configuration ENV SSH_HOSTNAME=server.example.com ENV SSH_USERNAME=username ENV SSH_DESTINATION=destination ENV SSH_DESTINATION_PORT=12345 ENV SSH_LOCAL_PORT=12345 ENTRYPOINT ssh \ -N -4 \ -L *:$SSH_LOCAL_PORT:$SSH_DESTINATION:$SSH_DESTINATION_PORT \ -l $SSH_USERNAME \ -o "StrictHostKeyChecking no" \ -o "UserKnownHostsFile /dev/null" \ $SSH_HOSTNAME