Start up the Docker container from image:
docker run --entrypoint "/bin/sh" --rm imagename:latest -c "sleep 24h"
Obtain the container hash id:
docker ps
Log into the running container using shell:
docker exec -ti containerid sh
Output logs of the container
docker logs -f containerid
docker rmi -f $(docker images -f "dangling=true" -q)