easy access into docker container without ssh :)


Recommended Posts

You do NOT need this at all on unRAID 6.0 beta12 or later. You want to use docker exec instead. It is built in. Nothing additional to do.

 

 

docker ps

root@REAVER:~# docker ps

CONTAINER ID        IMAGE                          COMMAND            CREATED            STATUS              PORTS                                                        NAMES     

2fcd05628929        gfjardim/nzbget:latest        "/sbin/my_init"    2 weeks ago        Up 3 days          0.0.0.0:7070->6789/tcp, 0.0.0.0:7073->6791/tcp                NZBGet         

f5097c71f899        gfjardim/transmission:latest  "/sbin/my_init"    2 weeks ago        Up 3 days          54321/tcp, 0.0.0.0:9091->9091/tcp, 0.0.0.0:12290->12290/tcp  Transmission   

 

docker exec -ti Transmission /bin/bash

 

root@REAVER:~# docker exec -ti Transmission /bin/bash

root@f5097c71f899:/# ls -al

total 0

drwxr-xr-x  1 root  root  204 Nov 23 00:41 .

drwxr-xr-x  1 root  root  204 Nov 23 00:41 ..

drwxr-xr-x  1 root  root  1400 Jun 24 14:43 bin

drwxr-xr-x  1 root  root    0 Apr 10  2014 boot

drwxrwxrwx  1 nobody users  108 Dec  5 00:03 config

drwxr-xr-x  4 root  root  400 Dec  3 03:17 dev

-rwxr-xr-x  1 root  root    0 Nov 23 00:41 .dockerenv

-rwxr-xr-x  1 root  root    0 Nov 23 00:41 .dockerinit

drwxrwxrwx  1 nobody users  108 Dec  3 03:15 downloads

drwxr-xr-x  1 root  root  2566 Dec  1 01:04 etc

drwxr-xr-x  1 root  root    0 Apr 10  2014 home

drwxr-xr-x  1 root  root  228 Jun 24 14:43 lib

drwxr-xr-x  1 root  root    40 Apr 16  2014 lib64

drwxr-xr-x  1 root  root    0 Apr 16  2014 media

drwxr-xr-x  1 root  root    0 Apr 10  2014 mnt

drwxr-xr-x  1 root  root    0 Apr 16  2014 opt

dr-xr-xr-x 273 root  root    0 Dec  3 03:15 proc

drwx------  1 root  root    80 Dec  1 01:04 root

drwxr-xr-x  1 root  root  202 Dec  3 03:15 run

drwxr-xr-x  1 root  root  2160 Jun 24 14:43 sbin

drwxr-xr-x  1 root  root    0 Apr 16  2014 srv

dr-xr-xr-x  13 root  root    0 Dec  6 17:23 sys

drwxrwxrwt  1 root  root    26 Dec  7 00:17 tmp

drwxr-xr-x  1 root  root    70 Jun 24 14:41 usr

drwxr-xr-x  1 root  root    90 Jun 24 14:43 var

root@f5097c71f899:/# exit

exit

  • Upvote 1
Link to comment

You do NOT need this at all on unRAID 6.0 beta12 or later. You want to use docker exec instead. It is built in. Nothing additional to do.

 

 

docker ps

root@REAVER:~# docker ps

CONTAINER ID        IMAGE                          COMMAND            CREATED            STATUS              PORTS                                                        NAMES     

2fcd05628929        gfjardim/nzbget:latest        "/sbin/my_init"    2 weeks ago        Up 3 days          0.0.0.0:7070->6789/tcp, 0.0.0.0:7073->6791/tcp                NZBGet         

f5097c71f899        gfjardim/transmission:latest  "/sbin/my_init"    2 weeks ago        Up 3 days          54321/tcp, 0.0.0.0:9091->9091/tcp, 0.0.0.0:12290->12290/tcp  Transmission   

 

docker exec -ti Transmission /bin/bash

 

root@REAVER:~# docker exec -ti Transmission /bin/bash

root@f5097c71f899:/# ls -al

total 0

drwxr-xr-x  1 root  root  204 Nov 23 00:41 .

drwxr-xr-x  1 root  root  204 Nov 23 00:41 ..

drwxr-xr-x  1 root  root  1400 Jun 24 14:43 bin

drwxr-xr-x  1 root  root    0 Apr 10  2014 boot

drwxrwxrwx  1 nobody users  108 Dec  5 00:03 config

drwxr-xr-x  4 root  root  400 Dec  3 03:17 dev

-rwxr-xr-x  1 root  root    0 Nov 23 00:41 .dockerenv

-rwxr-xr-x  1 root  root    0 Nov 23 00:41 .dockerinit

drwxrwxrwx  1 nobody users  108 Dec  3 03:15 downloads

drwxr-xr-x  1 root  root  2566 Dec  1 01:04 etc

drwxr-xr-x  1 root  root    0 Apr 10  2014 home

drwxr-xr-x  1 root  root  228 Jun 24 14:43 lib

drwxr-xr-x  1 root  root    40 Apr 16  2014 lib64

drwxr-xr-x  1 root  root    0 Apr 16  2014 media

drwxr-xr-x  1 root  root    0 Apr 10  2014 mnt

drwxr-xr-x  1 root  root    0 Apr 16  2014 opt

dr-xr-xr-x 273 root  root    0 Dec  3 03:15 proc

drwx------  1 root  root    80 Dec  1 01:04 root

drwxr-xr-x  1 root  root  202 Dec  3 03:15 run

drwxr-xr-x  1 root  root  2160 Jun 24 14:43 sbin

drwxr-xr-x  1 root  root    0 Apr 16  2014 srv

dr-xr-xr-x  13 root  root    0 Dec  6 17:23 sys

drwxrwxrwt  1 root  root    26 Dec  7 00:17 tmp

drwxr-xr-x  1 root  root    70 Jun 24 14:41 usr

drwxr-xr-x  1 root  root    90 Jun 24 14:43 var

root@f5097c71f899:/# exit

exit

Thanks for posting this Brit.  Hopefully it let's others know about the power of docker exec as well. This is a HUGE improvement from Docker and we are excited to see this in beta 12.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.