Refactor docker_container spec helper