Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SOLVED] Docker Container - How to Copy Files from SSH Bash to Unraid Array or Remote System??

Featured Replies

Hello, 

I have successfully connected to my Unraid SSH as I usually do, then figured out how to bash into a docker container to list the files of the root of that container
 

docker exec -it dockercontainername /bin/bash


I can then 'ls' to see the files I want to copy or move to either 
01. a location on the UnRAID array - eg. /mnt/cache
02. the windows system I am on

I can't figure out how to copy the file so I can gain access to it. Does anyone know the method to do this
I tried some cp commands and scp commands and have not been successful

I don't really want to have to do a hexdump and piece this together, there has to be a way to get content out of the docker container and back into another container

Im not talking about the containers on appdata/cache/dockerimagename
talking about the files within the docker container itself

Thank you,

Edited by bombz

Solved by bombz

  • Author
  • Solution

EDIT
After hunting and searching I was able to successfully figure out how to

 

  • connect to docker container
  • sudo and nano within docker
  • copy files from docker container to unraid
  • copy files from unraid to docker container(s)

 

 


How to connect to docker container:

docker exec -it contaidername /bin/bash
ls -l

To find the files or paths that need to be accessed for the copy command

 

exit

 

Add sudo & nano within docker container:


Sudo:

root@dockercontainerID# apk add sudo
(1/1) Installing sudo (1.9.10-r0)
Executing busybox-1.35.0-r17.trigger
OK: 279 MiB in 80 packages

 

Nano:

root@dockercontainerID:/# apk add nano
fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/1) Installing nano (6.3-r0)
Executing busybox-1.35.0-r17.trigger
OK: 277 MiB in 79 packages



 

How to copy files from docker container to UnRaid server:
 

root@servername:~# sudo docker cp containername:/filename.xxx ~/file path on unraid

-OR-

root@servername:~# sudo docker cp containername:/filename.xxx /file path on unraid

EXAMPLE:

root@servername:~# sudo docker cp mariadb:/filename.txt ~/mnt/cache/


 

How to copy files from Unraid server to docker container:
 

root@servername:~# sudo docker cp /unraid/location/123.txt containername:/

 

EXAMPLE::

root@servername:~# sudo docker cp /mnt/cache/123.txt mariadb:/



Hope that helps someone going down the same path as me tonight

 

Cheers!

Edited by bombz

  • bombz changed the title to [SOLVED] Docker Container - How to Copy Files from SSH Bash to Unraid Array or Remote System??

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.