How to transfer / copy files from docker container to local directory in ubuntu 18.04?

docker ps

Then once you have your container ID, you can run the following:

docker cp container_id:/path/to/your_file.txt /path/on/your/host

I think you can do something like this should do what you want to do. Try this from your terminal:

me@myvirtualbox: ~$ scp -p 8080 [email protected]:data/plot.png ./Downloads

you should provide your password for remote endpoint, and above solution should works for you.