Tips and Trics
Filter out just container name
docker ps | awk '{print $NF}' | grep -w somename
How to run more complex commands | docker exec
docker exec -i container_name bash -c "cd /root/python && python myscript.py"
List containers by name
docker ps --format '{{.Names}}'
Find the log path of container
docker container inspect YOURCONTAINERNAME --format "{{ .LogPath }}
Other Stuff
docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name vpn -v /home/$USER/temp/vpnclient-openvpn/profile-8.ovpn:/vpn/profile-8.ovpn -d dperson/openvpn-client
- Find out "docker run command" of running container
docker inspect \
--format "$(curl -s https://gist.githubusercontent.com/efrecon/8ce9c75d518b6eb863f667442d7bc679/raw/run.tpl)" \
<container_name_or_ID>
Remove dangling volumes
docker volume rm $(docker volume ls -qf dangling=true)