Overview
Teaching: 0 min Exercises: 15 minQuestions
Objectives
Pull (download) an image from Docker Hub
Run shell inside a container
Mount local folders
Apply software from the image to analyze local data
Let’s pull (download) an image:
docker pull bids/base_fsl
Where is this image coming from? From Docker Hub.
Let’s go inside
the container (an instance of an image) and poke around:
docker run -ti --rm bids/base_fsl
A Linux shell prompt should appear (independently of your host operating system!). Play around. Can you answer the following questions:
bet
?exit
). Run the container again. Are the files still there?Before we try to access files from the localhost lets get some example data
/home/me/docker_tutorial
Let’s mount this folder so it will be accessible from the container when we run it
docker run -ti --rm -v /home/me/docker_tutorial:/data bids/base_fsl
Excercises:
/data
folder inside the container?/data
folder? For example fslmaths /data/tfMRI_SOCIAL_TOM-RANDOM_zstat1.nii.gz -kernel gauss 10 -fmean /data/smoothed.nii.gz
Key Points
Container images are downloaded from Docker Hub.
You can run shell inside the container.
Only explicitly mounted host folder are accessible inside the container.