docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm --name wcont -it -v workdir:/home -w /home linuxdevenv:18.04 /bin/bash
- linuxdevenv:18.04 is the docker image, workdir is the dokcer volume
- wcont is a name the running docker conatiner can be identified with
- upon launch this will provide a shell, the -it option is required to launch a shell
docker volume create workdir
-
A docker conatiner is necessary to copy files into the docker-volume named workdir
-
Start a dummy container to facilitate copying
docker run -d --rm --name dummy -v workdir:/home ubuntu tail -f /dev/null
-
Copy all files from host directory dirname into docker-volume workdir
docker cp c:\dirname\* dummy:/home/*
-
Stop the container
docker stop dummy
docker cp dummy:/home/* c:\dirname\
docker save --output="output.tar" image_name
docker export --output="output.tar" container_id