devcontainer | Run and use devcontainer outside of Visual Studio Code | Code Editor library
kandi X-RAY | devcontainer Summary
kandi X-RAY | devcontainer Summary
Are you also a big fan of Visual Studio Devcontainer? Do you also sometimes want to just run the devcontainer outside of Visual Studio Code? Me also! That is why I have created this simple bash script. The script parses the devcontainer.json file and runs the docker container outside of Visual Studio Code.
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 devcontainer
devcontainer Key Features
devcontainer Examples and Code Snippets
Community Discussions
Trending Discussions on devcontainer
QUESTION
I installed laravel goto config extension in the remote containers and whenever I click on the link that extension generates and that should jump to another file vscode crashes and restarts
I've created the github issue with the extension creator but author doesn't have any experience with remote extensions. In the github issue I also linked github repository that you can use to reproduce the issue. Note that instead of
...ANSWER
Answered 2022-Mar-25 at 19:34I managed to pinpoint the issue. In the extension there was a line
QUESTION
I did this on my devcontainer.json
as specified here:
ANSWER
Answered 2022-Mar-05 at 22:29You need to specify that this is a bind mount.
QUESTION
I have a nice project with a .devcontainer config. Since the vscode update to 1.63 I have some trouble with the docker setup. Now I'm using the newest 1.64.0
I just want to build a new container with a clean volume an start in a fresh environment.
What happens is, that a new container is starting and I see some stuff from another container. Same if I clone a git repo into a container volume.
- Why are some containers connected with the same volume for the workspace?
- Why do I fall back every time to the same volume?
In the devcontainer.json I set:
...ANSWER
Answered 2022-Feb-12 at 12:04To build a new devcontainer in a fresh environment you can install devcotainer cli and trigger build manually.
I'm used to mount workspace as bind mount (on windows with wsl2 files) insted of volume mount, i think that the main issue is the volume name: if both project has "source=remote-workspace" the volume will be detected as the same.
With nodejs where I want to keep node_modules
folder inside container, I have done a double mount following this official vscode guide for this usecase.
So I have left workspaceMount as a default bindmount than I have added a volue that override a specific folder.
QUESTION
In a repo, we have a pre-commit configuration that requires version 2.2.1 of prettier:
...ANSWER
Answered 2022-Feb-02 at 17:28You can set the version in the .devcontainer like this:
QUESTION
Trying to build a docker image with the execution of a pre-requisites installation script inside the Dockerfile fails for fetching packages via apt-get from archive.ubuntu.com.
Using the apt-get
command inside the Dockerfile works flawless, despite being behind a corporate proxy, which is setup via the ENV
command in the Dockerfile.
Anyway, executing the apt-get
command from a bash-script in a terminal inside the resulting docker container or as "postCreateCommand" in a devcontainer.json of Visual Studio Code does work as expected too. But it won't work in my case for the invocation of a bash script from inside a Dockerfile.
It simply will tell:
ANSWER
Answered 2022-Jan-19 at 20:43As pointed out in the comment section underneath the question:
using sudo to launch the command, wiping out all the current vars set in the current environment, more specifically your proxy settings
So that is the case.
The solution is either to remove sudo from the bash script and invoke the script as root inside the Dockerfile.
Or, using sudo
will work with ENV
variables, just apply sudo -E
.
QUESTION
I'm trying to preconfigure a private container registry in a CodeSpace so workshop participants can use it. According to the docs it's all pretty straight forward, but it looks like I'm missing something, because it won't work, and the docs aren't clear on what I need to expect on the receiving end.
What I've done so far:
- I have a custom CodeSpace container image that inherits from univesal-linux:1.6.4
- I have configured the 3 documented variables:
- GH_CONTAINER_REGISTRY_SERVER=ghcr.io
- GH_CONTAINER_REGISTRY_USER=jessehouwing
- GH_CONTAINER_REGISTRY_PASSWORD=PAT with Packages (Read) permission
- I have rebuilt the codespace
- I tried a different prefix than
GH_
to no avail.
If I read the docs correctly, this should make sure docker can pull from ghcr using my credentials, but all I get is an error:
...ANSWER
Answered 2021-Sep-15 at 22:51A few questions to try and unblock you -
- Have you ensured that your secrets are available to the repository you're creating the codespace off of? You can click "Update" to see which repos have access to these secrets. More info here
- Did you create this codespace before your secrets were created? Secrets are only injected at codespace creation or restarting so if you added these secrets after creating the codespace, they won't be accessible in the codespace until after a restart. You can verify your secrets are accessible in the codespace by typing in
echo {SECRET_NAME}
and ensuring the secret is output.
Nothing looks out of sorts from what I can see but can investigate further once you verify the two questions above!
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
I have a repo which runs python on a docker container. Recently I have a purchased a new mac, and on this new workstation, this container is not building successfully when I try to open it with remote-container plug in from VS code.
...ANSWER
Answered 2021-Dec-29 at 22:46Reconsider your third-party dependency version-selection.
Docker Base ImageFROM python:3.8.3-buster
is Python 3.8
Dependency: Scipyscipy 1.3.3 (released 2019!!!) doesn't support Python 3.8
QUESTION
I'm having trouble installing a specific version of Python in my Github Codespace with VSCode. I don't have much experience with Docker, so this is turning into a really frustrating experience.
Here's my Dockerfile. It seems to always default to Python 3.8– how can I get it to install the latest version of 3.7?
...ANSWER
Answered 2021-Dec-24 at 02:12I think the easiest way would be to use a base image which comes with Python 3.7:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install devcontainer
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