Solved copy file into docker container

Currently reading
Solved copy file into docker container

259
28
NAS
DS1019+
Mobile operating system
  1. Android
i've got a docker installed that gives me an SQL2000 server (rsmoorthy/sql2000)
it works fine, but i need to restore a database in to it.
i have the database backup file, but i need to place the file inside the docker before i can import it.

how do i place the file inside it?
it doesn't seem to be able to open a bash window
 
Hmm, the dockerhub page mentions no container paths to be mapped out as volumes.
Seems like this image is supposed to write data into the container layer - this is way slower than writting data to a volume, as data is written in a copy-on-write layer on top of the image layers.

You can either use docker cp /path/in/ds {container name or id}:/path/in/container or stop the container, edit its details and bind-mount a host path to a container path in the "volume" tab.

I find it rather spooky that the image is 5 years old and not updated since. Also the missing hint about volums is a major turn off for me.
 
259
28
NAS
DS1019+
Mobile operating system
  1. Android
it being 5 years old is probably because SQL2000 stopped being used about 20 years ago šŸ˜†
i just use it as a test environment anyway. it saves me having to run a VM to host SQL.
 
259
28
NAS
DS1019+
Mobile operating system
  1. Android
You can either use docker cp /path/in/ds {container name or id}:/path/in/container or stop the container, edit its details and bind-mount a host path to a container path in the "volume" tab.

but won't i need to know the folder structure inside the container first?
 
From the perpective of docker: you can copy folders/files to any path in the container.

From the perspective of mssyl: not sure if it will accept any path to look for import, you will need to figure this out out. If only there would be some documentation to point you in the right direction *cough*
 
259
28
NAS
DS1019+
Mobile operating system
  1. Android
well i believe the docker provides things like "windows" (it's runs wine as it's base i believe).
when i attempt to import a database file it asks for the local location (from within the docker) and it presents a C and Z drive.

it seem even the developer can't remember how to do it.

Annotation 2020-05-14 181901.jpg
 
Last edited:
In the "how i build the imag" docs, I can see that they use hte path ~/.wine/drive_c.
Open a terminal in the container. execute "cd ~/.wine/drive_c", then execute "pwd" to get the absolute path to "drive c" in the container.... then copy your files to a sub folder of this path.

Ah, drive Z actualy is the container's filesystems root. Thus: copy the file wherever you want.

Update: Honestly, I would shut down the container, map a folder from the ds to the container path /sql_import (or something like that) and start the container again. Then you should be able to access the files from within the container from drive z:\sql_import.
 
259
28
NAS
DS1019+
Mobile operating system
  1. Android
sorted.
copied the backup file to /bin
then was able to import it via Z:\bin
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Similar threads

Similar threads

Trending threads

Top