how to ssh docker container

前端 未结 8 1620
抹茶落季
抹茶落季 2021-02-02 06:34

I am running the container hypriot/rpi-busybox-httpd

I am trying to ssh to docker container: but it is giving error :

pi@raspberrypi:~ $         


        
8条回答
  •  孤街浪徒
    2021-02-02 06:56

    You have many different ways to do that, you can attach using docker's attach command.

    $ sudo docker attach cc55da85b915 #by ID
    

    Or you can use docker exec command:

    $ sudo docker exec -i -t cc55da85b915 /bin/bash
    

    If /bin/bash fails, you can use /bin/sh that works in more containers:

    $ sudo docker exec -i -t cc55da85b915 /bin/sh
    

提交回复
热议问题