templates icon indicating copy to clipboard operation
templates copied to clipboard

dotnet template should include a volume mount for nuget package caching

Open carlin-q-scott opened this issue 1 year ago • 1 comments

Each time the container starts, all nuget packages need to be restored. The package and http caches should be persisted in volume mounts.

	"mounts": [
		"source=NuGetLocal,target=/home/vscode/.local,type=volume",
		"source=NuGet,target=/home/vscode/.nuget,type=volume"
	],
        "postCreateCommand": "chown vscode /home/vscode/.nuget /home/vscode/.local"

I don't totally understand the rhyme or reason for these two folders used by NuGet. They both contain configuration and caches, but of different kinds.

I also don't fully grasp how the mount system is supposed to work because the mounted volumes are owned by root instead of vscode by default, so I have to run chown as a postBuild script. At least this is in the documentation.

carlin-q-scott avatar Dec 28 '23 23:12 carlin-q-scott

It appears that your container user is a non-root user that is different from the host user who owns the Nuget directories. That is the reason why the documentation suggests to run the chown command, so that the container user can access the files.

As the documentation suggests:

This second step is not required if you will be running in the container as root.

eljog avatar Jan 04 '24 18:01 eljog