The issue appeared to be linked to trying to write data to the top level of the Docker container ('/').
Adding the following to the Jenkinsfile ensures that the home directory is set and the .dotnet folder can be created in a location with correct permissions.