SSH into container

I’d like to SSH into my prometheus container.

Nothing fancy in my Dockerfile

FROM prom/prometheus
ADD prometheus/config/prometheus.yml /etc/prometheus/prometheus.yml

(that’s it)

it is authenticating

debug1: Authentication succeeded (publickey).
Authenticated to ([ip]:22).

but shortly after it is disconnecting

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to closed.
Transferred: sent 2756, received 1584 bytes, in 16.0 seconds
Bytes per second: sent 172.0, received 98.9
debug1: Exit status 1

Pretty new to Docker, so had a hard time grasping the limitations to SSHing into containers here.

Any help?

Hi there,

Can you try adding these lines to the end of your Dockerfile?

RUN mkdir ~/.ssh
RUN chmod 0700 ~/.ssh

Let me know if that helps.


Hi Tyler, same error response