If you want the container id without the container running, this solves it:
docker inspect --format="{{.Id}}" <container_name> | sed 's/sha256://g'