Docker useful snippets
docker run -it -v <shared_folder>:<mounting_path> <image>
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container_name_or_id>
If GDB gives the error warning: Error disabling address space randomization: Operation not permitted than run the image with the following flags
docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
docker start -a <container_ID>
Sometimes the container doesn't work at all after this command, in that case run:
docker restart <container_ID>
docker attach <container_ID>
docker run -it --device=/dev/ttyUSB0 <image>
Assuming there is a valid Dockerfile in the current folder, just run
docker build -t container_name .
docker commit 5a8f89adeead newimagename
docker run -it -v "$PWD/dir1":/dir1 -v "$PWD/dir2":/dir2 newimagename