diff --git a/Dockerfile b/Dockerfile index 7d67453..75b8f21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,6 @@ RUN apk add --no-cache ca-certificates COPY --from=builder /app/sshserver /usr/local/bin/sshserver -ENV COMMAND /app/tui - EXPOSE 22 CMD ["/usr/local/bin/sshserver"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..025cece --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + ssh-server: + image: dcorral/ssh-remote:latest + ports: + - "22:22" + volumes: + - ../tui:/app/tui:ro + cap_add: + - SYS_CHROOT + environment: + - COMMAND=/app/tui + restart: unless-stopped \ No newline at end of file diff --git a/main.go b/main.go index 4862a0d..bdb9660 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,9 @@ import ( ) func main() { + if os.Getenv("COMMAND") == "" { + log.Fatal("COMMAND environment variable must be set") + } config := &ssh.ServerConfig{ NoClientAuth: true, }