Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 1.3 KB

README.md

File metadata and controls

40 lines (33 loc) · 1.3 KB

sshd-docker

Docker image with SSH daemon installed

Usage

This container is meant to be used to expose host ports to containers running in Docker. When using testcontainers in unit tests, refer to the documentation of testcontainers to find out how to use it:

Alternatively, you can start the container yourself:

services:
  sshd:
    image: testcontainers/sshd:1.2.0
    environment:
      PASSWORD: "SET_YOUR_PASSWORD_HERE"
    ports:
      - 10022:22

  requester:
    image: curlimages/curl
    command: /bin/sh -c "while true; do curl http://sshd:8080; sleep 5; done"
    depends_on:
      - sshd

And connect to it via ssh:

# ssh -R [remote_port]:[destination_address]:[local_port] [username]@[ssh_server] -p [ssh_port]
ssh -R 8080:localhost:8080 root@localhost -p 10022

Start your application and you should see requests coming from the requester service:

python3 -m http.server 8080