AFAIK layers are automatically garbage collected if you delete all images and containers that depend on them. Bear in mind that containers are not automatically deleted after shutting down, unless you give the --rm argument.
You can list them with docker ps -a, and delete all containers by running docker rm $(docker ps -aq).
You can list them with docker ps -a, and delete all containers by running docker rm $(docker ps -aq).