vscode-dev-containers | NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org | Continuous Deployment library
kandi X-RAY | vscode-dev-containers Summary
kandi X-RAY | vscode-dev-containers Summary
A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. The VS Code Remote - Containers extension and GitHub Codespaces allow you to open or clone code in a local or cloud-hosted dev container and take advantage of VS Code's full development feature set. This repository contains a set of dev container definitions to help get you up and running with a containerized environment. The definitions describe the appropriate container image, runtime arguments for starting the container, and VS Code extensions that should be installed. Each provides a container configuration file (devcontainer.json) and other needed files that you can drop into any existing folder as a starting point for containerizing your project. You can use the the Add Development Container Configuration Files... command to add one to your project or codespace. The vscode-remote-try-* repositories may also be of interest if you are looking for complete sample projects.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-dev-containers
vscode-dev-containers Key Features
vscode-dev-containers Examples and Code Snippets
Community Discussions
Trending Discussions on vscode-dev-containers
QUESTION
I'm trying out Github codespaces, specifically the "Node.js & Mongo DB" default settings.
The port is forwarded, and my objective is to connect with MongoDB Compass running on my local machine.
The address forwarded to 27017
is something like https://.githubpreview.dev/
I attempted to use the following connection string, but it did not work in MongoDB compass. It failed with No addresses found at host
. I'm actually unsure about how I even determine if MongoDB is actually running in the Github codespace?
ANSWER
Answered 2022-Jan-09 at 23:27As @iravinandan said you need to set up a tunnel.
Publishing a port alone won't help as all incoming requests are going through an http proxy.
If you dig CNAME .githubpreview.dev
you will see it's github-codespaces.app.online.visualstudio.com. You can put anything in the githubpreview.dev subdomain and it will still be resolved on the DNS level.
The proxy relies on HTTP Host header to route the request to correct upstream so it will work for HTTP protocols only.
To use any other protocol (MongoDb wire protocol in your case) you need to set up a TCP tunnel from codespaces to your machine.
Simplest set up - direct connectionAt the time of writing the default Node + Mongo codespace uses Debian buster, so ssh port forwarding would be the obvious choice. In the codespace/VSCode terminal:
QUESTION
I'm trying to use the "Node.js & Mongo DB" devcontainer from Microsoft (https://github.com/microsoft/vscode-dev-containers/tree/main/containers/javascript-node-mongo/.devcontainer) with my udp server made in Nodejs.
The problem is as follows: When i try to forward a port in devcontainer.json example : "forwardPorts": [1117]
.
It seems to only forward 1117/tcp when i actually want to forward 1117/udp.
I'm trying to making this work for this project : https://github.com/QuentinGruber/h1z1-server/blob/master/.devcontainer/devcontainer.json
...ANSWER
Answered 2021-Aug-31 at 20:04The documentation is kinda fuzzy regarding protocols used for exposed ports with forwardPorts
tag:
forwardPorts
- array
- An array of ports that should be forwarded from inside the container to the local machine.
Because of that I would recommend trying to use the older appPort
tag because when I looked here it said they're using the docker-compose syntax which means you can specify the ports and protocol like so:
docker-compose:
QUESTION
Windows 10 Docker Desktop on WSL2
Goal: serve an angular app from my devcontainer over my local network (specifically for testing on mobile)
Reproduce:
- Create a hello world angular application in a clean git repo
- clone the repo into a new devcontainer (Typescript/Node)
- serve the applcation
Things I've tried (and every permutation herein):
--network=host
(Never worked on windows, but thought it might on WSL2 - doesn't)- EXPOSE 4200
- runArgs: "-p 4200:4200"
- appPort: [4200]
- opening port 4200 on PC firewall
- ng serve --host 0.0.0.0 --port 4200
Additional Information:
- ng serve does allow me to view the site on my host machine
- cloning the repo to my host and running
ng serve --host 0.0.0.0
does allow me to access the site over my network (but moving in and out of the devcontainer isn't reasonable)
My current DockerFile
is pretty vanilla:
ANSWER
Answered 2021-Oct-19 at 18:47DockerFile
QUESTION
Is it possible to open files in a Docker container in my local operating system outside of the container using the Remote Development extension for VSCode (such as using right-click 'Open in Explorer' as in the Remote - WSL extension for VSCode)
I tried to:
- Build Docker Image Without Context
- Mount filesystem Volume so that I could access files in my operating system from my container without copying.
To build without context I can use docker build - < Dockerfile
(see docker docs).
I can mount files via docker run -v : IMAGE_NAME
(as discussed here, and in docker docs here)
From the devcontainer.json reference it's possible to pass build args to Docker build in your devcontainer.json but this doesn't work for the - <
as vscode-dev-containers defaults to including build context...
The extension also also automatically runs a container after build so I'm not sure how to override this.
Any tips would be much appreciated!
...ANSWER
Answered 2020-Oct-22 at 09:51TL;DR By default dev-containers extension (as of 22/10/2020) bind mounts files from local OS to container so can can open them on local OS.
For faster bind mounting (by skipping Sending build context to docker daemon...
during docker build .
step) ignore all in .dockerignore
& specify bind mount in .devcontainer/devcontainer.json
to mount file system to container.
QUESTION
I have a LAMP app that is running with a docker-compose deployment.
docker-compose.yml:
...ANSWER
Answered 2020-Jun-14 at 20:18Ah, so, a bit of a think later, the .devcontainer\docker-compose.yml ends with:
QUESTION
I am using Windows, installed Docker (using lunix containers), installed VS Code and the devcontainer extension. I loaded a project which is using Nugets from a private NugetFeed and as i am trying to restore (interactive) the NugetPackages I am getting a 401 error from my NugetFeed.
...ANSWER
Answered 2020-Jan-31 at 15:17Currently, there is no clean way to do it. I think the #1 solution should be much easier to setup.
Solution #1Open
.devcontainer/devcontainer.json
and add entry tomounts
section (you can change thesrc
value to something else - that's the name of the volume where your token will be stored):"src=credprovider-data,dst=${env:HOME}/.local/share/MicrosoftCredentialProvider,type=volume"
- Open
.devcontainer/Dockerfile
add at the end:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vscode-dev-containers
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page