Dockerfile 435 B

123456789101112131415161718
  1. FROM alpine:3.8
  2. RUN apk add --no-cache openssh-client
  3. COPY entrypoint.sh /
  4. RUN chmod a+rx /entrypoint.sh
  5. ENTRYPOINT ["/entrypoint.sh"]
  6. COPY ssh_config /etc/ssh/ssh_config
  7. RUN chmod a=r /etc/ssh/ssh_config
  8. RUN adduser -S tunnel
  9. COPY --chown=tunnel:nogroup known_hosts /home/tunnel/.ssh/known_hosts
  10. USER tunnel
  11. ENV BIND_ADDRESS bind-address
  12. ENV BIND_PORT 22
  13. CMD ssh -T -R $BIND_ADDRESS:$BIND_PORT:$DOCKER_HOST_ADDRESS:22 serveo.net