Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet template should include a volume mount for nuget package caching #225

Open
carlin-q-scott opened this issue Dec 28, 2023 · 1 comment

Comments

@carlin-q-scott
Copy link

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.

@eljog
Copy link
Member

eljog commented Jan 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants