How to mount data into Docker container image
Docker can be used to run applications and process the data in the container independently. This property also enables usage of tools otherwise not compatible with tools inside Sandbox IVM. Reading from input and writing to output data.
Here, as an example, we will copy a file inside a Docker container from input data to output data.
Open Terminal Emulatior in Sandbox. Pull docker from bioinformatics folder in Sandbox v3:
An example:
To list Docker images
returns
Assign a name (here "tools") to the container and run docker attaching mounting, library-red and /home/ivm/ in background (-d option) keeping STDIN open (-i option) and allocating a pseudo-TTY (-t option).
Source option will save your path to what you specify with target option.
To attach local standard input, output and error streams to a running container image and to check that the container is there:
that will returns (if nothing seems to happen press enter again):
Copy data from input to output data (named here input_data and output_data) inside container:
List folders in the container (Outputs your home/ivm content plus the file you copied using cp)
This will show list of folders and files in your output_data (here home/ivm) plus the file you just copied.
To exit container
Now the file you copied is found in "output_data" folder (in this example home/ivm/)
The copied folder is also visible in File Manager in Sandbox Desktop.
It should be noted that packages inside the Docker image can be used when attached to that image. Use of other sandbox tools outside Docker image is not possible when attached to the image.
See Samuel Jones user case of Docker image from FinnGen Users' meeting video 7th Sep 2021.
For more tutorials visit Docker page Best practices for writing Dockerfiles and see tutorial video How to Get Started with Docker.
If you like to use symbolic links with Docker, you can find tutorials for that e.g. from MYP Java Docker Logging Symlink Hack.
Last updated