Roman2K / autossh-docker

Dockerfile for autossh with automatic reconnection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

autossh-docker

A minimal Dockerfile for autossh with automatic reconnection, running as a regular user.

Usage

Example docker-compose configuration:

  1. Make myhost:8086 reachable within a Docker network through myhost-influxdb:8086:

      myhost-influxdb:
        image: autossh
        volumes:
          - type: bind
            source: $HOME/.ssh/id_rsa
            target: /home/app/.ssh/id_rsa
            read_only: true
          - type: bind
            source: $HOME/.ssh/config
            target: /home/app/.ssh/config
            read_only: true
        command: ['-N', '-L', '8086:localhost:8086', 'myhost']
  2. Or exposing :8086 by the host:

      myhost-influxdb:
        # <same as above>
        command: ['-N', '-L', '0.0.0.0:8086:localhost:8086', 'myhost']
        ports: ['127.0.0.1:8086:8086']

About

Dockerfile for autossh with automatic reconnection


Languages

Language:Shell 57.0%Language:Dockerfile 43.0%