Developing in a devcontainer #4804
-
Can anyone share how they're getting Aspire to work in a devcontainer? I'm trying to add Aspire to a project that I have already started to use it for managing local development. I want to do all of my service development inside of a devcontainer. I've sort of got it running but running into an issue with Blazor's web socket when trying to access the dashboard. I finally figured out the trust issues with the developer cert and I'm able to view the Aspire Dashboard over HTTPS. The browser is indicating that the dev cert is trusted. But the dashboard isn't working. I'm on a MacBook Pro M3 if it makes any difference. I'm seeing this error in the JavaScript console:
I'm running
I'm mounting the bind point for the {
"name": "MyApp",
"image": "mcr.microsoft.com/devcontainers/base:1.0.12-bookworm",
"mounts": [
{
"source": "${localEnv:HOME}/.aspnet/https/",
"target": "/home/vscode/.aspnet/https/",
"type": "bind"
},
{
"source": "${localEnv:HOME}/.microsoft/usersecrets/",
"target": "/home/vscode/.microsoft/usersecrets/",
"type": "bind"
}
],
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": "20.15.0"
},
"ghcr.io/devcontainers/features/azure-cli:1": {
"installBicep": true
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers/features/hugo:1": {
"extended": true,
"version": "0.128.2"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22.5"
},
"ghcr.io/devcontainers/features/ruby:1": {
"version": "3.1.6"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12.4"
},
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "8.0.302",
"workloads": "aspire"
},
"ghcr.io/nils-geistmann/devcontainers-features/zsh:0": {
"plugins": "dotnet git gitignore git-lfs git-prompt golang vscode"
},
"ghcr.io/dapr/cli/dapr-cli:0": {}
},
"postCreateCommand": ".devcontainer/scripts/install.sh",
"customizations": {
"vscode": {
"extensions": [
"akmittal.hugofy",
"asciidoctor.asciidoctor-vscode",
"budparr.language-vscode-hugo",
"eliostruyf.vscode-front-matter",
"eliostruyf.vscode-hugo-themer",
"esbenp.prettier-vscode",
"GitHub.vscode-github-actions",
"kaellarkin.hugo-shortcode-syntax",
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-bicep",
"ms-azuretools.vscode-docker",
"rusnasonov.vscode-hugo",
"ms-dotnettools.csdevkit",
"ms-dotnettools.csharp",
"ms-dotnettools.vscodeintellicode-csharp"
]
}
},
"remoteUser": "vscode",
"remoteEnv": {
"ASPNETCORE_Kestrel__Certificates__Default__Password": "password",
"ASPNETCore_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/appnamet.pfx"
},
"portsAttributes": {
"17098": {
"protocol": "https"
}
},
"containerEnv": {
"HUGO_MODULE_WORKSPACE": "/workspaces/sharedexperiences/hugo.work"
}
} The . ${NVM_DIR}/nvm.sh
if [ ! -d "node_modules" ]; then
echo "Installing NPM dependencies..."
npm ci
fi
bundle install |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@davidfowl is there any plan to support this setup? |
Beta Was this translation helpful? Give feedback.
Yes it’s in main. There’s more work @mitchdenny is doing to make it work more seamlessly with port forwarding.