https://www.docker.com/products/docker-desktop
git clone https://github.com/cfmitrea/docker-tutorial.git
cd docker_tutorial
curl -O https://bitbucket.org/snakemake/snakemake-tutorial/get/v5.2.3.tar.bz2
tar -xf v5.2.3.tar.bz2 --strip 1 --exclude='*.md'
docker build --rm -t samtools .
--rmremoves intermediate steps-ttags the image - e.g. samtools.look for the file Dockerfile in the current directory
docker run -v $(pwd)/data:/data/ -e "INPUT_FILE=A" --rm samtools:latest bash /opt/run.sh
-vmounts the folder data in the working directory into folder/datainside the docker container. The changes from within the container will be available after the container stops.-eset environment variable to be used inside the container - here we use the env. variable to pass the sample name. Alternative: change the bash script to use command line arguments.--rmremoves the container instance after it finishes. Alternative: use--namefor container identification and remove the container usingdocker rm -v <name>after completion
docker run -v $(pwd)/data:/data/ -v $(pwd)/run.sh:/opt/run.sh -e "INPUT_FILE=A" --rm -it samtools:latest /bin/bash
-itenable interacitve mode - in combination with the command /bin/bash starts the bash terminal and waits for commands inside the container-v $(pwd)/run.sh:/opt/run.shmounts the file run.sh from working directory to the file inside the container, such that the changes in the script are available within the container without the need to rebuild the image.