Coder Social home page Coder Social logo

microsoft / vscode-dev-containers Goto Github PK

View Code? Open in Web Editor NEW
4.7K 106.0 1.4K 13.89 MB

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!

Home Page: https://aka.ms/vscode-remote

License: MIT License

C# 0.44% Dockerfile 8.57% C++ 0.19% Python 0.90% Go 0.10% Java 0.37% JavaScript 7.34% PHP 0.02% Ruby 0.04% TypeScript 0.24% Swift 0.05% PowerShell 0.04% F# 0.03% Rust 0.13% Dart 0.04% Perl 0.01% R 0.02% Elm 0.04% Shell 81.42% CMake 0.02%
vscode codespaces vs containers devcontainer devcontainers docker remote visual-studio-code remote-development

vscode-dev-containers's Introduction

IMPORTANT NOTE: Dev containers have a new, expanded home in the dev containers GitHub org! We're so excited to connect with you there. To learn more, you can check out our migration announcement.

This repository is no longer active and was archived in November 2023. We've migrated most of the contents of this repo to the devcontainers GitHub org, as part of the work on the open Dev Container specification.

  • Features managed by the Dev Container spec maintainers (such as the VS Code team) are now in devcontainers/features.
  • Definitions/Templates managed by the Dev Container spec maintainers are now in devcontainers/templates.
  • mcr.microsoft.com/devcontainers and mcr.microsoft.com/vscode/devcontainers images are now published from devcontainers/images.

For new Templates/Features, you can now self-publish and optionally make them visible in-tool by following the steps one of the quick start repositories: Templates quick start, Features quick start. No need to submit a PR here anymore.

For more details, you can review the announcement issue and latest archiving announcement.


[Deprecated] VS Code / GitHub Codespaces Dev Container Definitions

Visual Studio Code logo Visual Studio Code Dev Containers and GitHub Codespaces
Open your code in the cloud, in a local container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.

IMPORTANT NOTE: As noted in the section above, this repository is no longer active and will be archived in November 2023.

A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. The VS Code Dev 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 definition templates 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 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.

Adding a definition to a project or codespace

  1. Either create a codespace for your repository or set up your local machine for use with the Dev Containers extension, start VS Code, and open your project folder.
  2. Press F1, and select the Add Development Container Configuration Files... command for Dev Containers or Codespaces.
  3. Pick one of the recommended definitions from the list or select Show All Definitions... to see all of them. You may need to choose the From a predefined container configuration definition... option if your project has an existing Dockerfile or Docker Compose file. Answer any questions that appear.
  4. See the definition's README for configuration options. A link is available in the .devcontainer/devcontainer.json file added to your folder.
  5. Run Remote-Containers: Reopen in Container to use it locally, or Codespaces: Rebuild Container from within a codespace.

Adding a definition to a repository

You can share a customized Dev Container definitions for your project by adding the files under .devcontainer to source control.

Anyone who then opens a local copy of your repo in VS Code will be prompted to reopen the folder in a container, provided they have the Dev Containers extension installed. Additionally, this will be used whenever someone creates a codespace in GitHub Codespaces for the repository.

Your team now has a consistent environment and tool-chain and new contributors or team members can be productive quickly. First-time contributors will require less guidance and there will be fewer issues related to environment setup.

Sample projects

If you want to try a sample project which already has a Dev Container, check out one of the following repositories:

Contents

Common Questions

Can I just reuse an existing container image or Docker / Docker Compose configuration?

Yes! If you have a Dockerfile or Docker Compose file in your project/repository, follow the same steps to add a definition and you'll be prompted to select a Dockerfile or Docker Compose file and customize from there. If you then commit these files to a Git repository, you can use it with GitHub Codespaces as well. If you prefer, you can also start up the container manually and attach to it. However, note that many images will be missing things like git that you will want to use. There are scripts in the script-library like the common script that can help adding these to your existing Dockerfile or image.

What is the goal of devcontainer.json?

A devcontainer.json file is similar to launch.json for debugging, but designed to launch (or attach to) a development container instead. At its simplest, all you need is a .devcontainer/devcontainer.json file in your project that references an image, Dockerfile, or docker-compose.yml, and a few properties. You can adapt it for use in a wide variety of situations.

Contributing and feedback

Have a question or feedback?

We've migrated most of the contents of this repo to the devcontainers GitHub org, as part of the work on the open Dev Container specification.

As a result, this repository only used for community definitions that have not been migrated elsewhere by their owners. If you are a community owner and want us to remove an existing definition here, feel free to submit a PR to do so!

For new Templates/Features, you can now self-publish and optionally make them visible in-tool by following the steps one of the quick start repositories: Templates quick start, Features quick start.

You can also:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See LICENSE.

For images generated from this repository, see LICENSE and NOTICE.txt.

vscode-dev-containers's People

Contributors

2percentsilk avatar aarynsmith avatar andreiborisov avatar anthonychu avatar bamurtaugh avatar bhack avatar brettcannon avatar brettmillerb avatar chrmarti avatar chuxel avatar cmendible avatar dantup avatar dependabot[bot] avatar dmgardiner25 avatar edgonmsft avatar egamma avatar eitsupi avatar felipecrs avatar joshspicer avatar jungaretti avatar kmehant avatar mjbvz avatar norelina avatar philliphoff avatar qubitron avatar samruddhikhandale avatar shikanime avatar tasdevani21 avatar testforstephen avatar xwiillz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-dev-containers's Issues

Consolidate layers

As discussed in #70, currently the Dockerfiles in dev container definitions in this repository use multiple layers to provide "cut-and-pasteable" sections that can be reused in existing Dockerfiles.

The downside with this approach is that it creates a number of unneeded layers and does not reflect best practice. To split the difference, we can shift these to use a single build layer with comments separating out the sections. Using && as the prefix instead of a suffix for the lines should also help developers understand what is going on and be able to still cut and paste into their own existing or new RUN statements.

For example:

FROM debian:9

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Set the default shell to bash rather than sh
ENV SHELL /bin/bash

# Configure apt and install packages
RUN apt-get update \
    && apt-get -y install --no-install-recommends apt-utils 2>&1 \
    # 
    # Verify git, process tools, lsb-release (useful for CLI installs) installed
    && apt-get update && apt-get -y install git procps lsb-release \
    #
    # Install C++ tools
    && apt-get -y install build-essential cmake cppcheck valgrind \
    #
    # Clean up
    && apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

The layer-consolidation can be used for WIP and any PRs (like #70) that are proposing this kind of thing.

We will need to run a solid regression test to make sure these edits don't break anything before merging.

Update copyfiles to avoid CVE warning once update available (but not a security issue)

Should be fixed by calvinmetcalf/copyfiles#66

However, note that this is a not actually a security issue and more of a possible DoS if used in something like a web server. In our case its used to copy files as a part of a bundling script, so this is a non-issue as the process immediately terminates after the operation is complete.

https://github.com/microsoft/vscode-dev-containers/network/alert/yarn.lock/mem/closed

python-3-anaconda does not build

  • VSCode Version: 1.36.1
  • Local OS Version: Windows 10 Pro 1809
  • Name of Dev Container Definition with Issue: python-3-anaconda

Steps to Reproduce:

  1. In vscode, open new empty folder
  2. ctrl+shift+p -> Remote-Containers: Open Folder in Container...
  3. Select python-3-anaconda from the list

Error when building dev container:

!!!previous output omitted!!!

Processing triggers for mime-support (3.62) ...
/bin/sh: 1: pip: not found
The command '/bin/sh -c apt-get update     && apt-get -y install --no-install-recommends apt-utils 2>&1     && apt-get -y install git procps lsb-release     && pip install pylint     && if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi     && rm -rf /tmp/conda-tmp     && apt-get autoremove -y     && apt-get clean -y     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 127

Possibly related to base image continuumio/anaconda3 making breaking changes to follow Docker best practices and trim their images: ContinuumIO/docker-images#120 (comment)

"New Class" from "C# Extensions" doesn't work in a container.

I know this repository is only meant for the containers definition issues, but I can't find a repo for the actual extension.

Version: 1.39.0-insider
Commit: 9f6a745027fc7b2a12495970f64625e24f410224
Date: 2019-09-24T05:24:32.949Z
Electron: 6.0.9
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 18.7.0

Steps to Reproduce:

  1. Start VS
  2. Open a folder with a tree-like structure of subfolders with code files in them.
  3. Try adding "New C# File" to a subfolder.

Expected: New file with correct namespace and name.
Result: Nothing happens.

Cheers

Go container fails

  • VSCode Version:
    Version: 1.41.1
    Commit: 26076a4de974ead31f97692a0d32f90d735645c0
    Date: 2019-12-18T14:57:51.166Z
    Electron: 6.1.5
    Chrome: 76.0.3809.146
    Node.js: 12.4.0
    V8: 7.6.303.31-electron.0
    OS: Darwin x64 18.7.0

  • Local OS Version: Mojave 10.14.6

  • Name of Dev Container Definition with Issue: go

Steps to Reproduce:

  1. Open any folder in container, select "Go" from templates
  2. Container build fails

As I can best tell, it is related to this commit in gopls, but I am not sure:
golang/tools@8647d4c

Java 8 & Tomcat 8.5 Build - The requested URL returned error: 404 Not Found

  • VSCode Version: 1.41
  • Local OS Version: Windows 10, 1803
  • Name of Dev Container Definition with Issue: Java 8 & Tomcat 8.5

Steps to Reproduce:

  1. Open Folder
  2. Add Development Container Configuration
  3. Select Java 8 & Tomcat 8.5
  4. Reopen Folder in Container

The build will fail with the error message: "The requested URL returned error: 404 Not Found"

Create devcontainers for popular repos

This issue is meant to be a hit list of repos that we want to have devcontainers for and any known issues associated with getting those setup.

For the most part these are the most forked repos on GitHub as well as some other notable projects.

Repo Owner Done Tested Known Issues
Angular @bowdenk7 Yes No
Bootstrap @bowdenk7 No Getting a headless browser setup in docker is hard
three.js
jekyll-now @mjbvz Yes
TensorFlow-Examples @mjbvz Yes
Learn OpenCV @mjbvz Yes
TensorFlow-Tutorials Requires jupyter notebooks
Jekyll @rebornix
D3
Vue
Spark
Animate.css
Lantern
Golang
Darknet
Flask
ElasticSearch
Swift
ASP.NET Core
Redis
Ghost

azure-functions-dotnetcore-latest does not build

azure-functions-dotnetcore-latest fails to build with the following error:

Unable to locate package azure-functions-core-tools

build image.txt

  • VSCode Version:1.38.1 and 1.39.0-insider
  • Local OS Version: Windows 10 version 1903 (OS Build 18362.356)
  • Name of Dev Container Definition with Issue: azure-functions-dotnetcore-latest

Steps to Reproduce:

Prereqs - remote (containers) extension and docker.

  1. Open an empty folder in vscode.
  2. Run 'Remote Containers: Add Development Container Configuration Files...' command and select 'Azure Functions and C# (.Net Core Latest)'.
  3. Reopen folder in container.

I've compared the Dockerfile and devcontainer.json between azure-functions-dotnetcore-2.1 and azure-functions-dotnetcore-latest and the only difference is the base image referenced in each Dockerfile. Could this be related to .NET Core latest Docker tags updated to 3.0 given that azure functions doesn't yet support .Net core 3.0?

Provide guidance for dealing with .NET self-signed certs

This is a fork of #133 given several other topics in that issue have been addressed.

Currently the dotnet dev container definitions and try repos do not provide good instructions for dealing with self signed certificates in a container environment.

The question is what the best practice should be for adapting to this and we can then at least include a reference to information on it if not update the definitions to have things set up correctly by default (depending on the recommendation).

kubernetes-helm container installs an old version of kubectl

  • VSCode Version: 1.36.0-insider
  • Local OS Version: MacOS 10.14.4
  • Name of Dev Container Definition with Issue: kubernetes-helm

Steps to Reproduce:

  1. Copy this directory https://github.com/microsoft/vscode-dev-containers/tree/master/containers/kubernetes-helm/.devcontainer
  2. Open it in VS Code
  3. kubectl version results with
    Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.0", GitCommit:"fff5156092b56e6bd60fff75aad4dc9de6b6ef37", GitTreeState:"clean", BuildDate:"2017-03-28T16:36:33Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

This is an old version which has some bugs like this SIGSEGV one. The latest stable version should be v1.14.3.

This is due to this way of installation:
https://github.com/microsoft/vscode-dev-containers/blob/2002d518b4162cb39fb4585e7a43db824094064d/containers/kubernetes-helm/.devcontainer/Dockerfile#L25:L28

Probably better to install kubectl following the instructions on the official website:
https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux

With a new Dockerfile old documentation should be updated as well:
https://github.com/microsoft/vscode-dev-containers/blob/master/containers/kubernetes-helm/README.md

Document Dev Container definition release process

Add documentation to describe how new Dev Container definitions (and updates to existing ones) propagate to VS Code. (E.g. it looks like vscode-dev-containers releases are created periodically, which are then eventually picked up by a new release of the remote-containers extension. However, I don't see any notes about the general timelines involved, release schedules, etc.)

Kubernetes missing certificate

  • VSCode Version: 1.34.0-insider (1.34.0-insider)
  • Local OS Version: macOS Mojare 10.14.4 (18E226)
  • Name of Dev Container Definition with Issue: Kubernetes & Helm

Steps to Reproduce:

  1. Click on "Reopen on Container"
  2. New terminal

Context:

Minikube certificates are not pull and paths are not replaced in the kube configuration.

- name: minikube
  user:
    client-certificate: /Users/USER_NAME/.minikube/client.crt
    client-key: /Users/USER_NAME/.minikube/client.key

$HOME as workspace

I work in Node.js a lot,

I use the nodejs docker image which contains the node user.

I set my projects repo pointed to the home directory of node e.g. /home/node

this allows me to forward my own .ssh credentials that I store locally in the repo directly to the home folder.

Is there a way to do this? Because I'm currently running into a ton of issues around getting a dev container setup.

Add default non-root user to all dev containers

While on mac and Windows, developers can run as root inside the container without trouble, on Linux, local bind mounts use the same permissions as the user inside the container. Since the docker daemon is typically running as root, this means all files that are created or modified are root.

To avoid this problem, you typically create a user with the same UID/GID in the container and pass in -u user-name-here to docker run or add user in docker-compose.yml.

If you are running Linux locally, the default user typically has a UID of 1000, so images like node provide a user in the container with this UID. Unfortunately, this is the exception rather than the rule.

To work around this issue, each dev container Dockerfile should provide a default non-root user with a argument based UID/GID and add comments into devcontainer.json and/or docker-compose.yml on how to use it.

For example:

# Or your actual UID, GID on Linux if not the default 1000
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Configure apt and install packages
RUN apt-get update \
    && apt-get -y install --no-install-recommends apt-utils 2>&1 \
    #
    # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
    && apt-get -y install git procps lsb-release \
    #
    # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
    && groupadd --gid $USER_GID $USERNAME \
    && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
    # [Optional] Uncomment the next three lines to add sudo support
    # && apt-get install -y sudo \
    # && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
    # && chmod 0440 /etc/sudoers.d/$USERNAME \
    #
    # Clean up
    && apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

devcontainer.json, then would have the following in it:

	// Uncomment the next line to use a non-root user. See https://aka.ms/vscode-remote/containers/non-root-user.
	// "runArgs": [ "-u", "1000"],

However, if your user has an UID other than 1000, you end up needing to update the Dockerfile.

If we supported a "buildArgs" property (microsoft/vscode-remote-release#46), this could be:

	// "runArgs": [ "-u", "1000"],
	// "buildArgs": [ "--build-arg", "USER_UID=1000", "--build-arg", "USER_GID=1000"],

Unfortunately, ${env:UID} does not pick up $UID. If we introduce microsoft/vscode-remote-release#1050 we could then improve this to be completely automatic:

	// "runArgs": [ "-u", "$(id -u):$(id -g)"],
	// "buildArgs": [ "--build-arg", "USER_UID=$(id -u)", "--build-arg", "USER_GID=$(uid -g)"],

python-3 container template's Dockerfile unnecessarily refers to requirements.txt.temp

  • Name of Dev Container Definition with Issue: python-3

The python-3 template Dockerfile requires a requirements.txt.temp file.

If this file is not present, then an error is thrown.

It copies the file into the docker build, but does not appear to do anything with this file.

Have I misunderstood the file's purpose, or is this possibly an artefact from earlier versions?

azure-functions-python-3 container fails

When installing the devcontainer, I get the following error:

 W: Conflicting distribution: https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch InRelease (expected stretch but got stable)
E: Failed to fetch https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/dists/stretch/main/binary-amd64/Packages.bz2  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:156065 [weak]
    - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
    - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
    - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
    - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak]
   Hashes of received file:
    - SHA512:a18b4df496d00477e52cf62e01c9f6c9534926ad0e3bf17f94fc28fc9bd91d5ee5e906b460477e2c1b280a5757a067937c9b2724bd6c72066e982a19306f28b8
    - SHA256:94e637dd6df186bbed5a19f2e7bdc2dcc8f7bb0feb2f1eaf93f05b45dd322cc4
    - SHA1:fb9e80e17952a577030e9266737b23269c8d878b [weak]
    - MD5Sum:
[190154 ms] 4360374f4ec05159ef14908c0dbf4116 [weak]
    - Filesize:68668 [weak]
   Last modification reported: Fri, 13 Dec 2019 01:35:23 +0000
   Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
  • VSCode Version: 1.41.0
  • Local OS Version: macOS Mojave 10.14.6
  • Name of Dev Container Definition with Issue: azure-functions-python-3

Steps to Reproduce:

  1. Include files in .devcontainer locally in your project
  2. Reopen in Container
  3. Wait for it to build and fail

opening container workspace results in blank unresponsive screen

  • VSCode Version: 1.40.2
  • Local OS Version: Darwin x64 19.0.0
  • Name of Dev Container Definition with Issue: web-service-locations (custom)

Steps to Reproduce:

  1. open dev container
  2. screen goes blank (background color) -- unresponsive, can only close window by using the red button, no menu bar actions or anything will work (even close window or cmd+w)
Version: 1.40.2
Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
Date: 2019-11-25T14:52:45.129Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0

No space left on device error

Hi all. When trying to build my docker image, I get the following error:

Error response from daemon: Error processing tar file(exit status 1): write /src/models/<path_to_model.pkl>: no space left on device

Despite having 600GB free space. Funnily enough, 30mins ago I rebuilt without issue and without change in the meantime. This error message doesn't really tell me anything. Also problem persists across different base images (Miniconda, RDKit, etc.).

  • VSCode Version: Latest insider release
  • Local OS Version: MacOS 10.15 Catalina
  • Name of Dev Container Definition with Issue: Miniconda

Dockerfile:


#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM mcs07/rdkit:latest

# Avoid warnings by switching to noninteractive

# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
# this user's GID/UID must match your local user UID/GID to avoid permission issues
# with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See
# https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Copy environment.yml (if found) to a temp locaition so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/

# Configure apt and install packages
RUN apt-get update \
    && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
    #
    # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
    && apt-get install -y\
        git\
        wget \
        tmux \
        vim \
        zsh \
        iproute2 \
        procps \
        iproute2\
        lsb-release\
        curl \
        exuberant-ctags \
    && curl -L http://install.ohmyz.sh | sh || true \
    && conda config --add channels conda-forge\
    # Install pylint
    && /opt/conda/bin/pip install pylint \
    #
    # Update Python environment based on environment.yml (if presenet)
    && if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
    && rm -rf /tmp/conda-tmp \
    #
    # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
    && groupadd --gid $USER_GID $USERNAME \
    && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
    # [Optional] Add sudo support for the non-root user
    && apt-get install -y sudo \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
    && chmod 0440 /etc/sudoers.d/$USERNAME \
    #
    # Clean up
    && apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=

devcontainer.json

{
	"name": "Python 3 - Miniconda",
	"context": "..",
	"dockerFile": "Dockerfile",

	// Use 'settings' to set *default* container specific settings.json values on container create.
	// You can edit these settings after create using File > Preferences > Settings > Remote.
	"settings": {
		"terminal.integrated.shell.linux": "/bin/zsh",
		"python.pythonPath": "/opt/conda/bin/python",
		"python.linting.enabled": true,
		"python.linting.pylintEnabled": true,
		"python.linting.pylintPath": "/opt/conda/bin/pylint"
	},

	// Uncomment the next line if you want to publish any ports.
	// "appPort": [],

	// Uncomment the next line to run commands after the container is created.
	// "postCreateCommand": "python --version",

	// Uncomment the next line to use a non-root user. On Linux, this will prevent
	// new files getting created as root, but you may need to update the USER_UID
	// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
	// "runArgs": [ "-u", "vscode" ],

	// Add the IDs of extensions you want installed when the container is created in the array below.
	"extensions": [
		"ms-python.python",
		"mechatroner.rainbow-csv",
		"RandomFractalsInc.vscode-data-preview",
		"patbenatar.advanced-new-file"
	]
}

environment.yml

dependencies:
  - jupyter
  - numpy
  - matplotlib
  - pandas
  - rdkit
  - scikit-learn
  - flask
  - waitress

Any help is highly appreciated

Unable to start dev conatiner

  • VSCode Version: 1.13.1
  • Local OS Version: Windows 7
  • Name of Dev Container Definition with Issue:

My windows 7 is unable to run dev containers using Docker Toolbox.
The Problem is a trivial one, docker does not recognise the paths to mount.

Docker just can't handle the additional : in the path.
I copied the command and replaced the "c:\Users..." with "\c\Users..." and it worked.

image

Would it be possible to create a workaround?

Feature: preCreateCommand just like postCreateCommand

This is slightly related to #106, but different. I want to have preCreateCommand just like there is postCreateCommand, e.g.

devcontainer.json

{
    "preCreateCommand": ["..."]
}

Which is ran before building or rebuilding the docker container.

I could use this e.g. to build the dependencies (bunch of other docker files) etc.

Use something like vscodeignore instead of npmignore for ignored files?

In https://github.com/microsoft/vscode-dev-containers/blob/master/CONTRIBUTING.md it says:

VS Code respects .npmignore as a way to keep certain content out of projects when your definition is used.

It feels really weird to put npmignore files in projects that have nothing to do with NPM and VS Code to use them. VS Code already has its own ignore file (for publishing extensions) so it seems like using that (or something else project-agnostic) would make much more sense than this? When tweaking the Dart container, I originally deleted this file thinking it was accidentally left over from starting from a node container!

(Also, the docs should be more clear exactly what this is doing, it's not really clear to me from that description exactly when those files are being ignored ignored?).

[java] Simplify Dockerfiles

Currently, the Dockerfiles for Java are based on Maven and then they add Gradle manually.

Nowadays it is common for Java projects (whether Maven or Gradle) to come with proper wrappers that will download either of these build tools when build is first triggered, therefore making it the case where the installed version may not even be used, if different than what is defined in the project.

Simplifying the Dockerfiles will reduce the size to build and run the image for the first time, as it involves two downloads (Maven image, and then Gradle).

Pre-build images for Microsoft maintained container images in this repository

Currently this repository includes a number of dev containers for people to use, but requires that the images be built. While this is great for an example, certain definitions like debian-9-git could clearly have a base image with git already installed and then just a sample Dockerfile for using it.

We can cherry pick a subset of these that are maintained by Microsoft and pre-build them much as we recommend for external contributions.

Default shell is now /bin/sh for all dev container definitions

A recent update had VS Code respect the default shell that the OS sets. An unfortunate side effect of this is that VS Code now uses /bin/sh as the shell since the SHELL env var is not set. Containers like kubernetes-helm rely on .bashrc which will fail with normal sh.

To avoid this problem, I propose we update all dockerfiles in dev container definitions to include:

ENV SHELL /bin/bash

@chrmarti Does this make sense to you as well?

The alternative would be to inject a linux terminal setting into the remote settings.json file.

We can also tweak the dev container definitions to work with sh, but I think that people will typically want bash, so it strikes me these dev container definitions should follow suit.

Create "kitchen sink" image based on core VS Online image to allow people to build up from it, use it offline

Related to #140, #154, and https://github.com/MicrosoftDocs/vsonline/issues/205, we can create a dev container based off of the current VS Online image (which itself is based on Oryx).

This will allow developers to:

  1. Simply use it locally if they prefer
  2. Make it easier to iterate on new dev containers from it for their own repositories that use it
  3. Make it easier to move back-and-forth between VSO and local
  4. Improve transparency about its exact contents

//cc: @lostintangent

Include better defaults for .NET containers

The documentation is woefully inadiquate for how to setup the debugging support for say .NET Core applications and these dev containers don't add the right stuff to ensure that the debugger will work.

The entries should be created in the launch.json and whatever ports etc. that are necessary should also be opened. Failing that the documentation needs to be updated to actually outline how this is supposed to work.

Problem with python dev-container definitions

  • VSCode Version: 1.34.0
  • Local OS Version: MacOS Mojave
  • Name of Dev Container Definition with Issue: python-3 python-2

Steps to Reproduce:

  1. After opening the definition in the container, the shell points to /workspaces/vscode-dev-containers/containers/python-3
  2. Seems like python-3 as workspace containing the test-project.
  3. The new workspace directory created does not stay in the dev-container folder rather it is in the root directory of the container.
  4. Looks like line 12 and 18 quite conflicting with respect to normal docker behavior as WORKDIR changes the current directory to workspace
  5. Let's say workspace which is in the root directory as my actual workspace then I have to add the workspace folder to my actual vs code workspace in order to work. This seems like two workspaces created.
  6. There is another serious issue as when I click the debug button that debugs the test code as mentioned in the launch.json file. So I have to update the program attribute with respect to my actual workspace which resides in the root directory.

Possible solution:

  1. As of now, the python modules are being installed globally. (as no python env are used) so it's better to remove lines 11, 12, 18 as they seem to be not required
  2. We will add the requirements.txt files to the /workspaces/vscode-dev-containers/containers/python-3 and then check and finally pip install modules.
  3. If needed then better to add custom workspace in this directory /workspaces/vscode-dev-containers/containers/python-3 For that we might need to pass the workspaceFolder value as an environment variable which we can use to create the workspace.

RUN mkdir /workspace
WORKDIR /workspace
# Install pylint
RUN pip install pylint
# Install Python dependencies from requirements.txt if it exists
COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/
RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi

containers/go: Go tool installation will not work with Go modules

The Go tools for development are installed here with a single command and with the -u flag. This will not work as expected if these tools are versioned using Go modules, and it may result in conflicting behavior if the tools share dependencies. Users may get an unexpected versions of these tools (in particular, gopls is versioned so master may be broken at the moment when the user installs it).

A better approach would be to stop using the -u flag, and to install tools individually in a temporary directory with a temporary go.mod file. As an example, VS Code Go does this.

[Tracking] Onboard additional definitions to image build

After #140 is complete, we can start to on-board more images. In some cases, changes to the definition are required while in others it's a matter of going through the process.

On-board to automatic image generation

Need to coordinate with the appropriate teams where applicable. In some cases, the team may prefer to build their own images - which works just fine as well.

Others less used definitions to consider:

  • Dart
  • Perl
  • R
  • Swift
  • PowerShell

Incoming to consider:

  • Incoming Julia definition should have its own pre-built image (See #450).
  • Azure Machine Learning team is looking at the Azure ML definition to determine whether they want to pre-build their own.

Update to base off of MCR image (once available)

Need to coordinate with 3rd party author where applicable.

  • Azure Ansible #472
  • Azure Blockchain
  • Azure CLI #473
  • Azure Terraform
  • Bazel #473
  • dapr-typescript-node-12
  • Elm
  • Jekyll
  • Markdown
  • PHP & Maria DB
  • Python & Postgres
  • Node & Mongo
  • Node & Postgres
  • Ruby Sinatra, Ruby on Rails

Salesforce, Puppet image is maintained by companies already.

Option to specify which services from docker-compose to launch.

In a current project repo, we have a fairly deep docker-compose file, with multiple optional services that can be launched for our developers. For example- our docker-compose.yml contains (among other things):

  1. backend api service (service: api)
  2. frontend client web app (service: client)
  3. database for api (service: db)
  4. web-based db admin tool (service dbadmin)
  5. redis server for backend tasks (service: redis)

We've then set up devcontainer.json files in both the backend and client directories, so that a developer can easily fire a container up for debugging, etc. The web-based db admin tool, for example, is rarely used by the front-end developers, and the redis server is almost never used locally (it is there for when we deploy). It would be nice to have an option in the devcontainer.json file for specific services to fire up. E.g. for the backend:

{
  ... 
  "launch": ["db", "api"],
  ...
}

while the frontend file might look like:

{
  ...
  "launch": ["client"]
  ...
}

This would keep unnecessary containers from spinning up. Then if a dev needed the redis server or dbadmin, they could manually launch those containers themselves.

Python Interactive does not work in Python 3 Anaconda dev container

Steps to Reproduce:

  1. Follow the Readme.md
  2. Run the Interactive Python - get stuck starting jupyter-server

I am not sure if the problem is related to vscode-python only or to vscode-dev-containers as well (it works without remote).

I report the issue in vscode-python as well #5676 Python Interactive does not work in Remote - Containers

Node + Postgres

Could you make a container template with node + postgres instead of mongodb?

Miniconda image doesn't build

On Windows 10 with the latest Insiders and Remote Containers.

It says AttributeError: 'str' object has no attribute 'copy' towards the end.

Setting up container for folder: c:\devel\vscode-dev-containers\containers\python-3-miniconda
Run: docker build -f c:\devel\vscode-dev-containers\containers\python-3-miniconda\.devcontainer\Dockerfile -t vsc-python-3-miniconda-3f2bbeffbfa57df76fd9141490bb6c13 c:\devel\vscode-dev-containers\containers\python-3-miniconda
Sending build context to Docker daemon  17.41kB
Step 1/9 : FROM continuumio/miniconda3
latest: Pulling from continuumio/miniconda3
e79bb959ec00: Already exists
2a7608a50ae3: Downloading [>                                                  ]  424.6kB/42.05MB
2a7608a50ae3:                                                                   2a7608a50ae3: Downloading [=>                                                 ]  850.6kB/42.05MB
ed7fdbb53a8b: Downloading [>                                                  ]  d7fdbb53a8b: Downloading [>                                                  ] 2a7608a50ae3: Downloading [=>                                                 ]  1.277MB/42.05MB
ed7fdbb53a8b: Downloading [>                                                  ] 2a7608a50ae3: Downloading [==>                                                ]  2.141MB/42.05MB                                                                ed7fdbb53a8b: Downloading [=>                                                 ] 2a7608a50ae3: Downloading [===>                                               ]  2.997MB/42.05MB
ed7fdbb53a8b: Downloading [=>                                                 ] 
2a7608a50ae3: Downloading [====>                                              ] 
 3.849MB/42.05MB
ed7fdbb53a8b: Downloading [=>                                                 ] 
2a7608a50ae3: Downloading [=====>                                             ] 
 4.701MB/42.05MB
ed7fdbb53a8b: Downloading [==>                                                ] 
2a7608a50ae3: Downloading [======>                                            ] 
 5.561MB/42.05MB
2a7608a50ae3: Downloading [=======>                                           ] 
 6.413MB/42.05MB
ed7fdbb53a8b: Downloading [==>                                                ] 
2a7608a50ae3: Downloading [========>                                          ] 
 7.269MB/42.05MB
ed7fdbb53a8b: Downloading [===>                                               ] 
2a7608a50ae3: Downloading [=========>                                         ] 
 8.125MB/42.05MB
ed7fdbb53a8b: Downloading [===>                                               ] 
2a7608a50ae3: Downloading [==========>                                        ] 
 8.973MB/42.05MB
ed7fdbb53a8b: Downloading [====>                                              ] 
2a7608a50ae3: Downloading [===========>                                       ] 
 9.825MB/42.05MB
ed7fdbb53a8b: Downloading [====>                                              ] 
2a7608a50ae3: Downloading [============>                                      ] 
 10.69MB/42.05MB
2a7608a50ae3: Downloading [=============>                                     ] 
 11.53MB/42.05MB
2a7608a50ae3: Downloading [==============>                                    ] 
 12.39MB/42.05MB
ed7fdbb53a8b: Downloading [=====>                                             ] 
2a7608a50ae3: Downloading [===============>                                   ] 
 13.26MB/42.05MB
ed7fdbb53a8b: Downloading [======>                                            ] 
2a7608a50ae3: Downloading [================>                                  ] 
 14.12MB/42.05MB
ed7fdbb53a8b: Downloading [======>                                            ] 
2a7608a50ae3: Downloading [=================>                                 ] 
 14.98MB/42.05MB
ed7fdbb53a8b: Downloading [=======>                                           ] 
2a7608a50ae3: Downloading [==================>                                ] 
 15.83MB/42.05MB
ed7fdbb53a8b: Downloading [=======>                                           ] 
2a7608a50ae3: Downloading [===================>                               ] 
 16.69MB/42.05MB
ed7fdbb53a8b: Downloading [========>                                          ] 
2a7608a50ae3: Downloading [====================>                              ] 
 17.54MB/42.05MB
ed7fdbb53a8b: Downloading [========>                                          ] 
2a7608a50ae3: Downloading [=====================>                             ] 
 18.39MB/42.05MB

2a7608a50ae3: Downloading [======================>                            ] 
 19.25MB/42.05MB
2a7608a50ae3: Downloading [=======================>                           ] 
 20.11MB/42.05MB
2a7608a50ae3: Downloading [========================>                          ] 
 20.96MB/42.05MB
ed7fdbb53a8b: Downloading [==========>                                        ] 
2a7608a50ae3: Downloading [=========================>                         ] 
 21.81MB/42.05MB
ed7fdbb53a8b: Downloading [==========>                                        ] 
2a7608a50ae3: Downloading [==========================>                        ] 
 22.67MB/42.05MB
ed7fdbb53a8b: Downloading [===========>                                       ] 
2a7608a50ae3: Downloading [===========================>                       ] 
 23.52MB/42.05MB
2a7608a50ae3: Downloading [============================>                      ] 
 24.38MB/42.05MB
2a7608a50ae3: Downloading [=============================>                     ] 
 25.23MB/42.05MB
ed7fdbb53a8b: Downloading [============>                                      ] 
2a7608a50ae3: Downloading [===============================>                   ] 
 26.09MB/42.05MB
ed7fdbb53a8b: Downloading [============>                                      ] 
2a7608a50ae3: Downloading [================================>                  ] 
 26.95MB/42.05MB
ed7fdbb53a8b: Downloading [=============>                                     ] 
2a7608a50ae3: Downloading [=================================>                 ] 
 27.82MB/42.05MB
ed7fdbb53a8b: Downloading [=============>                                     ] 
2a7608a50ae3: Downloading [==================================>                ] 
 28.67MB/42.05MB
2a7608a50ae3: Downloading [===================================>               ] 
 29.52MB/42.05MB
2a7608a50ae3:
2a7608a50ae3: Downloading [====================================>              ] 
 30.37MB/42.05MB
2a7608a50ae3: Downloading [=====================================>             ] 
 31.23MB/42.05MB
ed7fdbb53a8b: Downloading [===============>                                   ] 
2a7608a50ae3: Downloading [======================================>            ] 
 32.07MB/42.05MB
ed7fdbb53a8b: Downloading [===============>                                   ] 
2a7608a50ae3: Downloading [=======================================>           ] 
 32.92MB/42.05MB
ed7fdbb53a8b: Downloading [================>                                  ] 
2a7608a50ae3: Downloading [========================================>          ] 
 33.77MB/42.05MB
ed7fdbb53a8b: Downloading [================>                                  ] 
2a7608a50ae3: Downloading [=========================================>         ] 
 35.05MB/42.05MB
ed7fdbb53a8b: Downloading [=================>                                 ] 
2a7608a50ae3: Downloading [==========================================>        ] 
  35.9MB/42.05MB
ed7fdbb53a8b: Downloading [=================>                                 ] 
2a7608a50ae3: Downloading [===========================================>       ] 
 36.76MB/42.05MB
2a7608a50ae3: Downloading [============================================>      ] 
 37.61MB/42.05MB
2a7608a50ae3: Downloading [=============================================>     ] 
 38.47MB/42.05MB
ed7fdbb53a8b: Downloading [==================>                                ] 
2a7608a50ae3: Downloading [==============================================>    ] 
 39.32MB/42.05MB
ed7fdbb53a8b: Downloading [===================>                               ] 
2a7608a50ae3: Downloading [===============================================>   ] 
 40.18MB/42.05MB
2a7608a50ae3: Downloading [================================================>  ] 
 40.61MB/42.05MB
ed7fdbb53a8b: Downloading [===================>                               ] 
ed7fdbb53a8b: Downloading [====================>                              ] 
2a7608a50ae3: Downloading [=================================================> ] 
 41.46MB/42.05MB
2a7608a50ae3: Download complete
ed7fdbb53a8b: Downloading [=====================>                             ] 
ed7fdbb53a8b: Downloading [======================>                            ] 
2a7608a50ae3: Extracting [>                                                  ]  
  426kB/42.05MB
2a7608a50ae3: Extracting [==>                                                ]  
1.704MB/42.05MB
2a7608a50ae3: Extracting [====>                                              ]  
3.408MB/42.05MB
2a7608a50ae3: Extracting [=====>                                             ]  
4.686MB/42.05MB
2a7608a50ae3: Extracting [=======>                                           ]  
5.964MB/42.05MB
ed7fdbb53a8b: Downloading [=========================>                         ] 
2a7608a50ae3: Extracting [========>                                          ]  
7.242MB/42.05MB
ed7fdbb53a8b: Downloading [==========================>                        ] 
2a7608a50ae3: Extracting [==========>                                        ]  
 8.52MB/42.05MB
ed7fdbb53a8b: Downloading [==========================>                        ] 
2a7608a50ae3: Extracting [===========>                                       ]  
9.798MB/42.05MB
ed7fdbb53a8b: Downloading [===========================>                       ] 
ed7fdbb53a8b: Downloading [============================>                      ] 
2a7608a50ae3: Extracting [============>                                      ]  
10.65MB/42.05MB
ed7fdbb53a8b: Downloading [============================>                      ] 
2a7608a50ae3: Extracting [=============>                                     ]  
 11.5MB/42.05MB
2a7608a50ae3: Extracting [===============>                                   ]  
12.78MB/42.05MB
ed7fdbb53a8b: Downloading [=============================>                     ] 
2a7608a50ae3: Extracting [=================>                                 ]  
14.48MB/42.05MB
ed7fdbb53a8b: Downloading [==============================>                    ] 
2a7608a50ae3: Extracting [===================>                               ]  
16.19MB/42.05MB
2a7608a50ae3: Extracting [====================>                              ]  
17.47MB/42.05MB
ed7fdbb53a8b: Downloading [===============================>                   ] 
2a7608a50ae3: Extracting [======================>                            ]  
18.74MB/42.05MB
ed7fdbb53a8b: Downloading [================================>                  ] 
2a7608a50ae3: Extracting [=======================>                           ]  
20.02MB/42.05MB
ed7fdbb53a8b: Downloading [=================================>                 ] 
2a7608a50ae3: Extracting [=========================>                         ]  
21.73MB/42.05MB
ed7fdbb53a8b: Downloading [==================================>                ] 
2a7608a50ae3: Extracting [===========================>                       ]  
   23MB/42.05MB
2a7608a50ae3:
2a7608a50ae3: Extracting [============================>                      ]  
23.86MB/42.05MB
ed7fdbb53a8b: Downloading [====================================>              ] 
2a7608a50ae3: Extracting [=============================>                     ]  
24.71MB/42.05MB
2a7608a50ae3: Extracting [==============================>                    ]  
25.56MB/42.05MB
ed7fdbb53a8b: Downloading [======================================>            ] 
2a7608a50ae3: Extracting [================================>                  ]  
27.26MB/42.05MB
ed7fdbb53a8b: Downloading [=======================================>           ] 
2a7608a50ae3: Extracting [=================================>                 ]  
28.11MB/42.05MB
ed7fdbb53a8b: Downloading [=========================================>         ] 
2a7608a50ae3: Extracting [=================================>                 ]  
28.54MB/42.05MB
2a7608a50ae3: Extracting [==================================>                ]  
29.39MB/42.05MB
2a7608a50ae3: Extracting [====================================>              ]  
30.67MB/42.05MB
2a7608a50ae3: Extracting [=====================================>             ]  
31.95MB/42.05MB
ed7fdbb53a8b: Downloading [============================================>      ] 
2a7608a50ae3: Extracting [========================================>          ]  
33.65MB/42.05MB
ed7fdbb53a8b: Downloading [=============================================>     ] 
2a7608a50ae3: Extracting [=========================================>         ]  
34.93MB/42.05MB
ed7fdbb53a8b: Downloading [==============================================>    ] 
2a7608a50ae3: Extracting [===========================================>       ]  
36.21MB/42.05MB
ed7fdbb53a8b: Downloading [===============================================>   ] 
2a7608a50ae3: Extracting [============================================>      ]  
37.06MB/42.05MB
ed7fdbb53a8b: Downloading [================================================>  ] 
2a7608a50ae3: Extracting [=============================================>     ]  
37.91MB/42.05MB
2a7608a50ae3: Extracting [==============================================>    ]  
2a7608a50ae3: Extracting [===============================================>   ]  
2a7608a50ae3: Extracting [================================================>  ]  
2a7608a50ae3: Extracting [=================================================> ]  
2a7608a50ae3: Extracting [==================================================>]  
2a7608a50ae3: Pull complete
ed7fdbb53a8b: Extracting [>                                                  ]  
ed7fdbb53a8b: Extracting [=>                                                 ]  
ed7fdbb53a8b: Extracting [==>                                                ]  
ed7fdbb53a8b: Extracting [==>                                                ]  
ed7fdbb53a8b: Extracting [===>                                               ]  
ed7fdbb53a8b: Extracting [===>                                               ]  
ed7fdbb53a8b: Extracting [====>                                              ]  
ed7fdbb53a8b: Extracting [=====>                                             ]  
ed7fdbb53a8b: Extracting [=====>                                             ]  
ed7fdbb53a8b: Extracting [======>                                            ]  
ed7fdbb53a8b: Extracting [=======>                                           ]  
ed7fdbb53a8b: Extracting [========>                                          ]  
ed7fdbb53a8b: Extracting [==========>                                        ]  
ed7fdbb53a8b: Extracting [============>                                      ]  
ed7fdbb53a8b: Extracting [=============>                                     ]  
ed7fdbb53a8b: Extracting [===============>                                   ]  
ed7fdbb53a8b: Extracting [=================>                                 ]  
ed7fdbb53a8b: Extracting [==================>                                ]  
ed7fdbb53a8b: Extracting [===================>                               ]  
ed7fdbb53a8b: Extracting [====================>                              ]  
ed7fdbb53a8b: Extracting [=====================>                             ]  
ed7fdbb53a8b: Extracting [======================>                            ]  
ed7fdbb53a8b: Extracting [=======================>                           ]  
ed7fdbb53a8b: Extracting [=======================>                           ]  
ed7fdbb53a8b: Extracting [========================>                          ]  
ed7fdbb53a8b: Extracting [========================>                          ]  
ed7fdbb53a8b: Extracting [=========================>                         ]  
ed7fdbb53a8b: Extracting [==========================>                        ]  
ed7fdbb53a8b: Extracting [===========================>                       ]  
ed7fdbb53a8b: Extracting [============================>                      ]  
ed7fdbb53a8b: Extracting [=============================>                     ]  
ed7fdbb53a8b: Extracting [=============================>                     ]  
ed7fdbb53a8b: Extracting [=============================>                     ]  
ed7fdbb53a8b: Extracting [==============================>                    ]  
ed7fdbb53a8b: Extracting [==============================>                    ]  
ed7fdbb53a8b: Extracting [==============================>                    ]  
ed7fdbb53a8b: Extracting [===============================>                   ]  
 d7fdbb53a8b: Extracting [===============================>                   ]  
ed7fdbb53a8b: Extracting [===============================>                   ]  
ed7fdbb53a8b: Extracting [===============================>                   ]  
ed7fdbb53a8b: Extracting [================================>                  ]  
ed7fdbb53a8b: Extracting [================================>                  ]  
ed7fdbb53a8b: Extracting [=================================>                 ]  
ed7fdbb53a8b: Extracting [=================================>                 ]  
ed7fdbb53a8b: Extracting [=================================>                 ]  
ed7fdbb53a8b: Extracting [==================================>                ]  
ed7fdbb53a8b: Extracting [==================================>                ]  
ed7fdbb53a8b: Extracting [===================================>               ]  
ed7fdbb53a8b: Extracting [===================================>               ]  
ed7fdbb53a8b: Extracting [===================================>               ]  
ed7fdbb53a8b: Extracting [====================================>              ]  
ed7fdbb53a8b: Extracting [=====================================>             ]  
ed7fdbb53a8b: Extracting [======================================>            ]  
ed7fdbb53a8b: Extracting [=======================================>           ]  
ed7fdbb53a8b: Extracting [=========================================>         ]  
ed7fdbb53a8b: Extracting [==========================================>        ]  
ed7fdbb53a8b: Extracting [============================================>      ]  
ed7fdbb53a8b: Extracting [==============================================>    ]  
ed7fdbb53a8b: Extracting [================================================>  ]  
ed7fdbb53a8b: Extracting [=================================================> ]  
ed7fdbb53a8b: Extracting [=================================================> ]  
ed7fdbb53a8b: Extracting [==================================================>]  
ed7fdbb53a8b: Pull complete
d9f5448383b9: Extracting [==================================================>]  
d9f5448383b9: Pull complete
e902202dc40d: Extracting [==================================================>]  
e902202dc40d: Pull complete
Digest: sha256:97c73cf6b1aef82bb9f79d9ee82bdcb7bcef07d508fa270bc608bf61d7e98bec
Status: Downloaded newer image for continuumio/miniconda3:latest
 ---> 6b5cf97566c3
Step 2/9 : COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
 ---> e4dc523820e4
Step 3/9 : RUN apt-get update && apt-get -y install git procps
 ---> Running in 5c919c51ce76
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [487 kB]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [31.7 kB]
Get:7 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7082 kB]
Fetched 7907 kB in 6s (1182 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.11.0-3+deb9u4).
The following additional packages will be installed:
  libprocps6 psmisc
The following NEW packages will be installed:
  libprocps6 procps psmisc
0 upgraded, 3 newly installed, 0 to remove and 4 not upgraded.
Need to get 431 kB of archives.
After this operation, 1434 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 libprocps6 amd64 2:3.3.12-3+deb9u1 [58.5 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 procps amd64 2:3.3.12-3+deb9u1 [250 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 psmisc amd64 22.21-2.1+b2 [123 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 431 kB in 1s (330 kB/s)
Selecting previously unselected package libprocps6:amd64.
(Reading database ... 10409 files and directories currently installed.)
Preparing to unpack .../libprocps6_2%3a3.3.12-3+deb9u1_amd64.deb ...
Unpacking libprocps6:amd64 (2:3.3.12-3+deb9u1) ...
Selecting previously unselected package procps.
Preparing to unpack .../procps_2%3a3.3.12-3+deb9u1_amd64.deb ...
Unpacking procps (2:3.3.12-3+deb9u1) ...
Selecting previously unselected package psmisc.
Preparing to unpack .../psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libprocps6:amd64 (2:3.3.12-3+deb9u1) ...
Setting up procps (2:3.3.12-3+deb9u1) ...
update-alternatives: using /usr/bin/w.procps to provide /usr/bin/w (w) in auto mode
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Removing intermediate container 5c919c51ce76
 ---> b2e9a374f3dd
Step 4/9 : RUN mkdir /workspace
 ---> Running in d1ffff4b18af
Removing intermediate container d1ffff4b18af
 ---> b40d8d8509cb
Step 5/9 : WORKDIR /workspace
 ---> Running in 3360c59961ee
Removing intermediate container 3360c59961ee
 ---> 94639a2e5f8c
Step 6/9 : RUN pip install pylint
 ---> Running in 328e2e53c512
Collecting pylint
  Downloading https://files.pythonhosted.org/packages/60/c2/b3f73f4ac008bef6e75bca4992f3963b3f85942e0277237721ef1c151f0d/pylint-2.3.1-py3-none-any.whl (765kB)
Collecting isort<5,>=4.2.5 (from pylint)
  Downloading https://files.pythonhosted.org/packages/9a/a2/2dc9c43667a5a18c8956dc9c0e771d4e7d69de2c1b2689f2231a7aed7695/isort-4.3.18-py2.py3-none-any.whl (42kB)
Collecting astroid<3,>=2.2.0 (from pylint)
  Downloading https://files.pythonhosted.org/packages/d5/ad/7221a62a2dbce5c3b8c57fd18e1052c7331adc19b3f27f1561aa6e620db2/astroid-2.2.5-py3-none-any.whl (193kB)
Collecting mccabe<0.7,>=0.6 (from pylint)
  Downloading https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Requirement already satisfied: six in /opt/conda/lib/python3.7/site-packages (from astroid<3,>=2.2.0->pylint) (1.12.0)
Collecting lazy-object-proxy (from astroid<3,>=2.2.0->pylint)
  Downloading https://files.pythonhosted.org/packages/55/08/23c0753599bdec1aec273e322f277c4e875150325f565017f6280549f554/lazy-object-proxy-1.3.1.tar.gz
Collecting typed-ast>=1.3.0; implementation_name == "cpython" (from astroid<3,>=2.2.0->pylint)
  Downloading https://files.pythonhosted.org/packages/17/9e/00918af7bdd616decb5b7ad06a9cd0a4a247d2fccaa630ab448a57e68b98/typed_ast-1.3.5-cp37-cp37m-manylinux1_x86_64.whl (736kB)
Collecting wrapt (from astroid<3,>=2.2.0->pylint)
  Downloading https://files.pythonhosted.org/packages/67/b2/0f71ca90b0ade7fad27e3d20327c996c6252a2ffe88f50a95bba7434eda9/wrapt-1.11.1.tar.gz
Building wheels for collected packages: lazy-object-proxy, wrapt
  Building wheel for lazy-object-proxy (setup.py): started
  Building wheel for lazy-object-proxy (setup.py): finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/a0/63/e2/6d93295282cb35b53b14b50b602c76dfb04471e21b31d8ad7b
  Building wheel for wrapt (setup.py): started
  Building wheel for wrapt (setup.py): finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/89/67/41/63cbf0f6ac0a6156588b9587be4db5565f8c6d8ccef98202fc
Successfully built lazy-object-proxy wrapt
Installing collected packages: isort, lazy-object-proxy, typed-ast, wrapt, astroid, mccabe, pylint
Successfully installed astroid-2.2.5 isort-4.3.18 lazy-object-proxy-1.3.1 mccabe-0.6.1 pylint-2.3.1 typed-ast-1.3.5 wrapt-1.11.1
Removing intermediate container 328e2e53c512
 ---> 3670f922163f
Step 7/9 : COPY .devcontainer/environment.yml.temp environment.yml* /workspace/
 ---> 51489d809c35
Step 8/9 : RUN if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi
 ---> Running in 77180b3b1c0d

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/conda/exceptions.py", line 1003, in __call__
        return func(*args, **kwargs)
      File "/opt/conda/lib/python3.7/site-packages/conda_env/cli/main.py", line 73, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/opt/conda/lib/python3.7/site-packages/conda_env/cli/main_update.py", line 69, in execute
        directory=os.getcwd())
      File "/opt/conda/lib/python3.7/site-packages/conda_env/specs/__init__.py", line 40, in detect
        if spec.can_handle():
      File "/opt/conda/lib/python3.7/site-packages/conda_env/specs/yaml_file.py", line 18, in can_handle
        self._environment = env.from_file(self.filename)
      File "/opt/conda/lib/python3.7/site-packages/conda_env/env.py", line 143, in from_file
        return from_yaml(yamlstr, filename=filename)
      File "/opt/conda/lib/python3.7/site-packages/conda_env/env.py", line 129, in from_yaml
        data = validate_keys(data, kwargs)
      File "/opt/conda/lib/python3.7/site-packages/conda_env/env.py", line 33, in validate_keys
        new_data = data.copy() if data else {}
    AttributeError: 'str' object has no attribute 'copy'

`$ /opt/conda/bin/conda-env update base -f environment.yml`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
               CONDA_ROOT=/opt/conda
                     PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
                          :/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : None
       user config file : /root/.condarc
 populated config files : 
          conda version : 4.6.14
    conda-build version : not installed
         python version : 3.7.3.final.0
       base environment : /opt/conda  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.6.14 requests/2.21.0 CPython/3.7.3 Linux/4.9.125-linuxkit debian/9 glibc/2.24
                UID:GID : 0:0
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

The command '/bin/sh -c if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi' returned a non-zero code: 1
Failed: Building an image from the Dockerfile.
Command failed: C:\Program Files\Docker\Docker\Resources\bin\docker.exe build -f c:\devel\vscode-dev-containers\containers\python-3-miniconda\.devcontainer\Dockerfile -t vsc-python-3-miniconda-3f2bbeffbfa57df76fd9141490bb6c13 c:\devel\vscode-dev-containers\containers\python-3-miniconda

vscode-remote-try-docker-in-docker

About "docker-in-docker" and similar:

Currently there is dockerfile in .devcontainer folder, which defines development container

However there is no example of dockerfile outside .devcontainer folder. Please add some dockerfile which, after deploying, writes to console / displays "hello world".

Such dockerfile should allow to create production container, not development container.

I assume here that such dockerfile should be separate, but maybe I am misunderstanding things, I am beginner in docker world

Feature: Use a specific target from the multistaged Dockerfile

Imagine following multistaged Dockerfile:

# Build something etc.
FROM debian:buster-slim as building
RUN ...

# Main image
FROM debian:buster-slim as main
RUN ...

# Development env
FROM main as dev
RUN ...

# Released version
FROM main

There should be setting for the target, right now I must create whole new Dockerfile for vscode and I can't just use the dev env.

I suggest adding a buildArgs or similar to pass to the build phase of the vscode remote:

devcontainer.json

{
    "name": "My Thing",
    "dockerFile": "Dockerfile",
    "buildArgs": ["--target", "dev"], // pass these to the build phase for vscode remote
    "runArgs": [
        "--privileged"
    ],
    ...
}

Alternatively there could be preCreateCommand. Which could be used to do the same thing, a bit more complicate but anyway.

Deprecate javascript/typescript-node-8, python-2 containers once out of support

Node.js 8.x and Python 2.x are EOL as Jan 1, 2020.

We should delete these containers from this repository so we:

  1. Do not encourage use of runtimes that are no longer supported
  2. Keep the number of versions of a given runtime to a list that is easy for customers to find/understand

Ideally, we'd do this after #140 is in since this also will add reference comments in devcontainer.json that are tied to a tag, so developers would still be able to get to the old information if they were using it.

non-vanilla Python containers are caching wheels when installing pylint

  • VSCode Version:
  • Local OS Version:
  • Name of Dev Container Definition with Issue:
    • python-3-anaconda
    • python-3-miniconda
    • python-3-postgres

Steps to Reproduce:

  1. Look at the Dockerfile
  2. Notice the step to install Pylint doesn't have a --no-cache-dir flag like on the python-2 and python-3 containers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.