devcontainer | Run and use devcontainer outside of Visual Studio Code | Code Editor library

 by   BorisWilhelms Shell Version: Current License: MIT

kandi X-RAY | devcontainer Summary

kandi X-RAY | devcontainer Summary

devcontainer is a Shell library typically used in Editor, Code Editor, Visual Studio Code, Docker applications. devcontainer has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

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

            kandi-support Support

              devcontainer has a low active ecosystem.
              It has 9 star(s) with 2 fork(s). There are no watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              devcontainer has no issues reported. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of devcontainer is current.

            kandi-Quality Quality

              devcontainer has 0 bugs and 0 code smells.

            kandi-Security Security

              devcontainer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              devcontainer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              devcontainer is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              devcontainer releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of devcontainer
            Get all kandi verified functions for this library.

            devcontainer Key Features

            No Key Features are available at this moment for devcontainer.

            devcontainer Examples and Code Snippets

            No Code Snippets are available at this moment for devcontainer.

            Community Discussions

            QUESTION

            Is it possible to use DocumentLink and registerUriHandler when using the remote containers?
            Asked 2022-Mar-25 at 19:34

            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:34

            I managed to pinpoint the issue. In the extension there was a line

            Source https://stackoverflow.com/questions/71560395

            QUESTION

            How to mount /dev/bus/usb on VSCode's devcontainer for docker?
            Asked 2022-Mar-05 at 22:29

            I did this on my devcontainer.json as specified here:

            ...

            ANSWER

            Answered 2022-Mar-05 at 22:29

            You need to specify that this is a bind mount.

            Source https://stackoverflow.com/questions/71366286

            QUESTION

            vscode jumps to a specific volume afer reopen in container
            Asked 2022-Feb-12 at 12:04

            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.

            1. Why are some containers connected with the same volume for the workspace?
            2. Why do I fall back every time to the same volume?

            In the devcontainer.json I set:

            ...

            ANSWER

            Answered 2022-Feb-12 at 12:04

            To 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.

            Source https://stackoverflow.com/questions/71027734

            QUESTION

            How do I specify a specific prettier version in a VSCode .devcontainer?
            Asked 2022-Feb-02 at 17:28
            Background

            In a repo, we have a pre-commit configuration that requires version 2.2.1 of prettier:

            ...

            ANSWER

            Answered 2022-Feb-02 at 17:28

            You can set the version in the .devcontainer like this:

            Source https://stackoverflow.com/questions/69449987

            QUESTION

            Docker build fails to fetch packages from archive.ubuntu.com inside bash script used in Dockerfile
            Asked 2022-Jan-19 at 20:43

            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:43

            As 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.

            Source https://stackoverflow.com/questions/70614233

            QUESTION

            Preconfigure Container Registry in Codespaces
            Asked 2022-Jan-19 at 14:21

            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:51

            A few questions to try and unblock you -

            1. 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
            2. 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!

            Source https://stackoverflow.com/questions/69194963

            QUESTION

            How do I connect to MongoDB, running in Github codespaces, using MongoDB Compass?
            Asked 2022-Jan-09 at 23:27

            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/

            My attempt

            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:27

            As @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 connection

            At 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:

            Source https://stackoverflow.com/questions/70296667

            QUESTION

            How to forward a UDP port from a devcontainer?
            Asked 2022-Jan-09 at 14:17

            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:04

            The 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:

            Source https://stackoverflow.com/questions/69002661

            QUESTION

            Python docker container not building
            Asked 2021-Dec-29 at 22:46

            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:46

            Reconsider your third-party dependency version-selection.

            Docker Base Image

            FROM python:3.8.3-buster

            is Python 3.8

            Dependency: Scipy

            scipy 1.3.3 (released 2019!!!) doesn't support Python 3.8

            Source https://stackoverflow.com/questions/70521760

            QUESTION

            Codespaces: Force python version
            Asked 2021-Dec-24 at 02:12

            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:12

            I think the easiest way would be to use a base image which comes with Python 3.7:

            Source https://stackoverflow.com/questions/70468821

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install devcontainer

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/BorisWilhelms/devcontainer.git

          • CLI

            gh repo clone BorisWilhelms/devcontainer

          • sshUrl

            git@github.com:BorisWilhelms/devcontainer.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link