Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New environment configuration file: /etc/devcontainer #3593

Open
felipecrs opened this issue Aug 28, 2020 · 27 comments
Open

New environment configuration file: /etc/devcontainer #3593

felipecrs opened this issue Aug 28, 2020 · 27 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality plan-review PM-highlighted item determined to be P1 or P2

Comments

@felipecrs
Copy link

felipecrs commented Aug 28, 2020

A new option in devcontainer.json:

{
  "sourceEtcDevcontainer": true // defaults to true
}

This option makes the Remote - Containers extension always execute commands in the container using the following syntax:

$ docker exec ubuntu sh -c "test -f /etc/devcontainer && . /etc/devcontainer; echo 'hello world'"

Unless the user sets it to false.

This will not interfere in userEnvProbe behavior.

The /etc/devcontainer file must be a shell script compatible with Bourne Shell /bin/sh.

This would enable us to have a clean and unique environment configuration file that would work across all the users (root and non-root), and all the shells, without the caveats of /etc/profile or bash.bashrc.

So global environment variables can be set using scripts and not only through the Dockerfile's ENV statement, or the devcontainer.json's containerEnv, thus making the installation scripts easier to use since they would not require the user to manually inject some statements in the Dockerfile.

This would mainly benefit the scripts from script-library on vscode-dev-containers repository, which are used for doing common customizations on the containers. As explained here (bullet number 2).

@chrmarti
Copy link
Contributor

Does "userEnvProbe" in the devcontainer.json not solve this?

@chrmarti chrmarti self-assigned this Aug 31, 2020
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Aug 31, 2020
@felipecrs
Copy link
Author

I'll test it soon and let you know. Thanks.

@felipecrs
Copy link
Author

felipecrs commented Sep 1, 2020

@chrmarti Yes, this is what I was looking for, but with a caveat.

Without "userEnvProbe": "loginInteractiveShell" it does not work:

Code_xQdtxS8Zr1

But with "userEnvProbe": "loginInteractiveShell" it works as expected:

Code_5GAzbW2qIt

However, I was actually looking for an option loginShell and not loginInteractiveShell, which translates to sh -l and sh -l -i respectively.

And, I'm proposing to make loginShell option as the default value instead of none. The reason is:

This would mainly benefit the scripts from script-library on vscode-dev-containers repository, which are used for doing common customizations on the containers. As explained here (bullet number 2).

This would enable us to switch from:

ARG PYTHON_VERSION="3.8.3"
ARG PYTHON_INSTALL_PATH="/usr/local/python${PYTHON_VERSION}"
ENV PIPX_HOME="/usr/local/py-utils"
ENV PATH="${PYTHON_INSTALL_PATH}/bin:${PATH}:${PIPX_HOME}/bin"

RUN bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/python-debian.sh")" -- "${PYTHON_VERSION}" "${PYTHON_INSTALL_PATH}" "${PIPX_HOME}"

to:

RUN bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/python-debian.sh")"

@chrmarti
Copy link
Contributor

chrmarti commented Sep 2, 2020

"userEnvProbe" doesn't affect the building of the Docker image. Couldn't you change your Dockerfile to use RUN bash -l -c "..." if using a login shell allows you to shorten it?

Taking this as the feature request to add "loginShell" for "userEnvProbe".

@chrmarti chrmarti added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Sep 2, 2020
@chrmarti chrmarti added this to the September 2020 milestone Sep 2, 2020
@PavelSosin-320
Copy link

Why it is better than entry-point script? Container is not multitenant. Repetitive login can create sibling processes that will be never killed by init during the termination and become ghost OS processes. This is very dangerous.

@felipecrs
Copy link
Author

felipecrs commented Sep 2, 2020

"userEnvProbe" doesn't affect the building of the Docker image. Couldn't you change your Dockerfile to use RUN bash -l -c "..." if using a login shell allows you to shorten it?

@chrmarti This is not about that, this is about setting up container wide environment not by using ENV. By the way, if someone wants to do what you said, it's better to use SHELL [ "bash", "-l", "-c" ].

Did you check my example? With "userEnvProbe": "loginInteractiveShell", VSCode process was able to find the custom Python executable even without setting the ENV PATH on the Dockerfile.

@felipecrs
Copy link
Author

felipecrs commented Sep 2, 2020

Why it is better than entry-point script?

I don't understand how this is related to the entry point script. Remember that entry point script is not run on docker exec. I actually want to assure that entry point is executed by default, but it's a totally different history.

Container is not multitenant. Repetitive login can create sibling processes that will be never killed by init during the termination and become ghost OS processes. This is very dangerous.

I use login shell in my Linux environments since ever, and I don't see anything dangerous in /etc/profile. Even if something could be found (such as starting a process), this block would probably check if there is a command already started. Such as the ssh-agent.

Also, the login environment would be only applied to the command which we are executing, it would not affect other running shells for example.

That said, do you have any reference for what you said? Or an example?

@Chuxel
Copy link
Member

Chuxel commented Sep 2, 2020

@chrmarti I'm actually a +1 on doing this by default. There's actually quite a bit of code in vscode-dev-containers that is working around this particular scenario. The big problem is scripts that must be sourced to get the path to work correctly. SDKMAN, nvm, rvm all are like this. I'm adding things the containers install to the PATH when possible, but this only covers a limited set. In the SDKMAN case there are a number of tools it can install. Worse yet, rvm throws up warnings if things are in the path and the targets are not easily predictable (e.g. the gem path). To your point, we could probably add SHELL to work around it, but I could see someone trying to create their own dev container hitting this and being confused.

@chrmarti
Copy link
Contributor

chrmarti commented Sep 3, 2020

The issue with /etc/profile is that in some images (e.g., Alpine and Debian) it overwrites PATH (investigation #3224 (comment)), so additions to PATH via ENV are lost (bug #544). Due to that we changed to run with no startup scripts sourced.

One option is to probe the environment with an interactive non-login shell ("userEnvProbe": "interactiveShell"), but that adds to the startup time (numbers on my machine #3224 (comment)) so we decided to not do that by default.

@chrmarti
Copy link
Contributor

chrmarti commented Sep 8, 2020

@Chuxel Are there any workarounds that cannot be replaced with the recently added "userEnvProbe"?

chrmarti added a commit to microsoft/vscode that referenced this issue Sep 8, 2020
@Chuxel
Copy link
Member

Chuxel commented Sep 8, 2020

@chrmarti I don't believe so. I need to do a more complete test. This last release there was enough change already that I opted to keep things as they were.

@chrmarti
Copy link
Contributor

chrmarti commented Sep 9, 2020

@Chuxel If it turns out that you have to use "userEnvProbe": "interactiveShell" on almost all definitions we should reconsider the default.

I expect "loginShell" "loginInteractiveShell" to be used less often due to some /etc/profile overwriting PATH. If those would be better choices, we could think about somehow merging the two PATHs. That is not trivial because the order of PATH entries matters and we might need another property for the user to configure (or turn off) that - so we need good reasons to (also) take that approach.

@felipecrs
Copy link
Author

felipecrs commented Sep 9, 2020

The problem of using "interactiveShell" is (as the name says) that the shell is interactive, which means that at any point, bash or zsh can prompt the user for something. Not ideal in this case.

@chrmarti merging the two PATHs seems to be an interesting approach. The order would need to be respected as it is today: Docker ENVs comes before the /etc/profile ones.

@Chuxel
Copy link
Member

Chuxel commented Sep 10, 2020

@felipecrs Typically CLIs are smart enough to determine when they should prompt even in an interactive shell due to piping. As @chrmarti mentions, .profile can do all sorts of crazy things and typically also fires .bashrc under the hood, so of the two, interactive generally gives the expected results.

@felipecrs
Copy link
Author

@Chuxel 'typically' is not a rule, right? The rule is: interactive terminals may ask the user for input. But it will probably work, as you suggest.

And the /etc/bash.bashrc is only sourced by /etc/profile if running in an interactive shell (that's why it checks for $PS1).

By the way, you're talking about .profile and .bashrc, but I suppose you are referring to /etc/profile and /etc/bash.bashrc and not ~/.profile and ~/.bashrc, right?

In the end, I [again] suggest using the standard way to customize the system's environment on Linux: adding as many .sh files you want in the /etc/profile.d/ rather than editing /etc/bash.bashrc or even /etc/profile directly.

@felipecrs
Copy link
Author

felipecrs commented Sep 10, 2020

I also think that the all sorts of crazy things are not so crazy:

$ docker run --rm alpine sh -c 'cat /etc/profile; cat /etc/profile.d/*.sh'
cat: can't open '/etc/profile.d/*.sh': No such file or directory
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PAGER=less
export PS1='\h:\w\$ '
umask 022

for script in /etc/profile.d/*.sh ; do
        if [ -r $script ] ; then
                . $script
        fi
done
$ docker run --rm debian sh -c 'cat /etc/profile; cat /etc/profile.d/*.sh'
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
cat: '/etc/profile.d/*.sh': No such file or directory
$ docker run --rm ubuntu sh -c 'cat /etc/profile; cat /etc/profile.d/*.sh'
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
# Make sure the locale variables are set to valid values.
eval $(/usr/bin/locale-check C.UTF-8)

It seems that the only problem is thePATH.

@Chuxel
Copy link
Member

Chuxel commented Sep 11, 2020

@Chuxel 'typically' is not a rule, right?

@felipecrs Yep! That's why the property exists - so you can adapt to your situation.

@felipecrs
Copy link
Author

felipecrs commented Sep 11, 2020

@Chuxel Yeah, this is true. But the point of this issue is to come up with a better default approach, not only for my situation.

The concerns raised about relying on the /etc/profile (loginShell) are valid. Fixing up PATH variable does not seem right to me, too intrusive, which makes this option not feasible.

And as I said, relying on interactiveShell isn't a good idea as well, as I said previously. This would also make bashrc to be sourced twice if the user opens a new bash under VSCode. Besides that, bash.bashrc and zshrc can also do all sorts of crazy things, and we don't want that, we just want to load our environment customizations.

So I think I have a better proposal:

A new option in devcontainer.json:

{
  "sourceEtcDevcontainer": true // defaults to true
}

This option makes the Remote - Containers extension always execute commands in the container using the following syntax:

$ docker exec ubuntu sh -c "test -f /etc/devcontainer && . /etc/devcontainer; echo 'hello world'"

Unless the user sets it to false.

This will not interfere in userEnvProbe behavior.

The /etc/devcontainer file must be a shell script compatible with Bourne Shell /bin/sh.

This would enable us to have a clean and unique environment configuration file that would work across all the users (root and non-root), and all the shells, without the caveats of /etc/profile or bash.bashrc.

@Chuxel @chrmarti could you please review this new proposal?

@chrmarti
Copy link
Contributor

Note that the 'userEnvProbe' only starts a corresponding shell and uses printenv to extract the environment variables, it does not use that shell for anything else. So bashrc is sourced twice, but not in the same shell or a subshell. That should not cause the trouble you anticipate above. VS Code is using the same approach locally (except there it is always an interactive login shell and you cannot disable it).

We would probably use the same approach (printenv) to extract the environment variables if we added support for /etc/devcontainer, so we only source it once and are not forced to always use a shell.

jpda added a commit to jpda/vscode that referenced this issue Sep 14, 2020
* Add back hideHover and use on tree context menu show
Fixes microsoft#106268

* Update distro

* 💄

* explorer: Fix TrustedTypes violation

microsoft#106285

* produce deb, rpm packages

* Add loginShell (microsoft/vscode-remote-release#3593)

* chore - tweak onDidAddNotebookDocument, onDidRemoveNotebookDocument event, use ResourceMap and fix confusion between models and editors

* notebook update

* pinned tabs - update setting enum name

* Use innerText over innerHTML, microsoft#106285

* rename to IHostColorSchemeService

* API proposal for tree item icon color
Part of microsoft#103120

* chore - when target might be undefined use `target?.dispose()` over `dispose(target)`

* deprecate onDidChangeCells

* Reenable notebook smoke test microsoft#105330

* deprecate onDidChangeContent

* Add numeric values support for terminal.integrated.fontWeight

* unified onDidChangeContent

* node-pty@0.10.0-beta17

Fixes microsoft#105957

* 💄

* debt - remove _unInitializedDocuments

* remove `NotebookDocument#displayOrder` , fixes microsoft#106305

* no uninitialized documents.

* chore - update references viewlet

* debug: make serverReadyAction play nicely with js-debug

Fixes microsoft#86035
Fixes microsoft/vscode-js-debug#440

* fix rpm

* high contrast switching in browser

* Fix occasional bad custom selectbox layout
Fix microsoft#106302

* review comments

* Bump vscode-ripgrep for ARM
microsoft#6442

* Revert more specific class names for editor tokens

Reverts microsoft#103485
Fixes microsoft#106261

I believe that microsoft#103485 broke cases where the markdown renderer creates tokenized strings that are used outside of an editor's dom node (such as in hovers or in webviews)

The safest fix for now is to revert it. We can revist this and make the markdown renderer handle the tokenized output better next iteration

* remove emit selections.

* merge conflict resolve.

* fix integration tests.

* Disable errors in non-semantic supported files

Fixes microsoft#106299
Fixes microsoft#106314

Also enables js/ts features on the right side of PRs and in search results

* proper fix for microsoft#105202 (microsoft#106293)

* Only enable 'open with' on files

Fixes microsoft#106291

* Add WebviewView.description

Allow configuring the description for webview views.

This is rendered next to the title in a less prominently in the title

* Remove manual strikethroughs for deprecated properties in vscode.d.ts

Now that TS has support for `@deprecated`, these manual strike throughs should no longer be required.

* Add show method to webview view

Fixes microsoft#106085

* Skip failing test

* fix microsoft#106283

* enable test

* fix microsoft#106283

* pinnedTabSizing.standard => pinnedTabSizing.normal

* install dot net core sdk

* update distro

* tabs - align icon and text vertically centered in tab

* update distro

* distro

* fix microsoft#106308

* Update gitignore decorations when .git/info/exclude file is edited (microsoft#106270)

* detect local `exclude` file edits

* use `uri.path` to detect exclude file edits

`uri.path` uses forward slash as a path separator indepentent of
the host system, which makes it easier to use with regex

* updated searches

* editor - rename context keys variables

* fix microsoft#105999

* pinned tabs - prevent to close pinned tabs via Cmd+W (microsoft#100738)

* Reduce usage of `.innerHTML` (microsoft#106285)

* fix uninstalling extension

* remove unused import

* add `replaceNotebookMetadata` (should become `replaceMetadata`) to NotebookEditorEdit, microsoft#105283

* add `replaceNotebookMetadata`, microsoft#105283

* use textContent instead of innerHTML (for microsoft#106285)

* chore - move appyWorkspaceEdit from extHostTextEditors to (new) extHostBulkEdits and mainThreadBulkEdits

* chore - extract extHostNotebookDocument for the NotebookDocument and NotebookCell types and friends

* chore - extract ExtHostNotebookEditor into its own file

* chore - remove ExtHostNotebookEditor#uri and use document.uri instead

* chore - 💄 member order: property, ctor, method

* publish arm deb and rpm

* trusted types

related to microsoft#106285

* use async await

* distro

* update trusted types search

* trusted types - use textContent for style elements, fyi @rebornix

* fix arch

* Fix compile after merge

* Use instantiation service to create TerminalLinks

* Consolidate colon trim logic

* Avoid slice when checking colon

* Check length again

I prefer chatAt over slice as it's more obvious what's happening

* Move comment into helper function

* Update extensions/git/src/commands.ts

* Update extensions/git/src/commands.ts

* Update extensions/git/src/commands.ts

* Save prompt is shown while saving from settings split json editor (fix microsoft#106330)

* Only allow configurePlugin against main TS Server

Fixes microsoft#106346

Looks like the TS Server doesn't support this in partial mode at the moment

* Adding more explicit typings for promises

This gets us ready for TS 4.1

* Don't use async on abstract functions

* chore - use workingCopyService.isDirty instead notebook.isDirty

* Update Codicons
- Update 'pinned'
- Add 'export'
- Compress 'merge'
microsoft/vscode-codicons@5bcb1a0

* Add explicit undefined parameters / types

These errors come from the new stricter types for Promises in TS 4.1

* debt - IMainNotebookController#removeNotebookDocument

* debt - invoke resolve notebook when opening a notebook in an editor, not when loading a notebook from source

* do not need isUntitled.

* 💂 polish nb tests.

* remove selections from nb text model.

* replace changeCellLanguage to applyEdit

* fix microsoft#105916. expand metadata section if modified.

* move dirty state to NotebookEditorModel.

* chore, simply notebook text model event emitter

* refs microsoft#106285

* Add subscribers action

* Fix terminal ts 4.1 compile issues

Part of microsoft#106358

* Fix ts 4.1 issues in terminal api tests

* Update Codicons: add 'graph-left'
microsoft/vscode-codicons@dd1edb2

* initialize notebook text model data only through ctor.

* 💄

* Mark property readonly

* Enable webview commands for webview views

Fixes microsoft#105670

Previously our webview commands assumed that webviews were always going to be in an editor. This is no longer true with webview views.

To fix this, I've added an `activeWebview` to the `IWebviewService`. This  tracks the currently focused webview.

* microsoft#106358

* debug: bump js-debug-companion

* re microsoft#105735.

* re microsoft#105735. no more udpateMetadata api.

* Fix microsoft#106303

* Use destructuring to make code more clear

* Add isWritableFileSystem api

Fixes microsoft#91697

This new API checks if a given scheme allows writing

* Revert "Fix microsoft#106303"

This reverts commit 8e5eed1.

this is causing a layer check issue

* Cache webview view title across reloads

Fixes microsoft#105867

* fix some TS 4.1 errors (microsoft#106358)

* fix some TS 4.1 errors (microsoft#106358)

* fix TS 4.1 compile errors, microsoft#106358

* pinned tabs - flip default to "shrink"

* fix ts errors

related to microsoft#106358

* pinned tabs - closing pinned tab should open next non-pinned

* pinned tabs - add a tab.lastPinnedBorder color

* Adds commands for --no-verify commit variants (microsoft#106335)

* add `{allow,confirm}NoVerifyCommit`  options

* adds commit comands with no verify

* handles no verify command variants

* handle no verify commit option

* only display no verify variants when option is set

* trusted types

related to microsoft#106395

* more TS 4.1 fixes (microsoft#106358)

* update trusted types search

* Fix TS 4.1 errors for tasks and remote explorer
Part of microsoft#106358

* Adress microsoft#106358: Fix TS 4.1 errors in codebase

* debt - simplify metadata edit because we now have CellEditType.DocumentMetadata

* Fix Trusted Types violations (round #2) microsoft#106395

* debug: return result of a msg to debug adapter can be undefined

* add ExtHostFileSystemInfo which knows what schemes are reserved and which are used, microsoft#91697

* fixes microsoft#106334

* web - fix bad credentials lookup

* Correct path to code-workspace.xml

Fixes microsoft#106384

* Multi git executable paths (microsoft#85954)

* Multi git executable path

* update `git.path` setting description

* 💄

Co-authored-by: João Moreno <joao.moreno@microsoft.com>

* Correct linux code-workspace path

* fixes microsoft#104047

* Add defaultUriScheme to path service (microsoft#106400)

Fixes microsoft/vscode-internalbacklog#1179

* 💄

* Fix  microsoft#106303

* Avoid innerHTML (microsoft#106395)

* Avoid innerHTML (microsoft#106395)

* debt - REMOTE_HOST_SCHEME => Schemas.vscodeRemote

* fixes microsoft#106355

* pathService - defaultUriScheme() => defaultUriScheme

* Adjust active terminal tab when active tab moves (microsoft#106413)

Fixes microsoft#106300

* debt - adopt defaultUriScheme also for userHome

* debt - adopt defaultUriScheme over hardcoded vscode-remote in toLocalResource

* some integration tests for notebook editing, microsoft#105283

* refs microsoft#106358

* Bump yargs-parser in /extensions/markdown-language-features (microsoft#106373)

Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2.
- [Release notes](https://github.com/yargs/yargs-parser/releases)
- [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md)
- [Commits](https://github.com/yargs/yargs-parser/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump yargs-parser in /extensions/css-language-features/server

Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2.
- [Release notes](https://github.com/yargs/yargs-parser/releases)
- [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md)
- [Commits](https://github.com/yargs/yargs-parser/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* Remove arrays.findIndex

For microsoft#103454

This should be a direct map to the `.findIndex` mathod

* Use textContnet for style element

For microsoft#106395

* use textcontent in menu css
refs microsoft#106395

* Fix one innerHTML usage microsoft#106395

* Use `@example` tags in vscode.d.ts (microsoft#106352)

`@example` is the standard way to document code examples. This also gets us syntax highlighting of code examples in hovers

* - reload only local user configuration after initi
- add perf mark up and logs

* re microsoft#105735. batch apply edits.

* notebook text model initialization does not increment version

* private outputs slice and unknown change.

* applyEdit supports begin/end selections.

* replace insertCell with applyEdit.

* do not copy execution related metadata

* 💄

* fix build.

* Document view.type contribution

Fixes microsoft#105821

* Improve views contribution point

- add required properties
- add default snippet
- use `markdownDescription` for markdown string

* Replace our arrays.find with stdlib find

For microsoft#103454

* Pin blob storage dep
see Azure/azure-sdk-for-js#11187

* unit tests for batched edits.

* remove spliceNotebook api from textmodel.

* update exploration branch

* Fix some trusted type violations, microsoft#106395

* fix fonts in monaco menu

* update distro

* some jsdoc for microsoft#54938

* try to fix build (linux)

* electron - set spellcheck: false again for windows

* update search file, microsoft#106395

* 🆙 web playground

* Trusted types - don't use innerHTML for rapid render, microsoft#106395

* Remove Schemas.vscodeRemote from simple file dialog

* debt - remove some any casts from window

* update distro

* fix linux build

* argh

* proxy authentication does not work on 1.49 (microsoft#106434)

* do not use hasClass and first

microsoft#103454

* debug and explroer: do not use dom.addClass, dom.toggleClass

* do not use deprecated dom helper methods

microsoft#103454

* adopt new amd loader with support for TrustedScriptURL, add typings for TrustedTypesFactory et al, microsoft#106396

* explorer: Should maintain row focus after deleting a file

fixes microsoft#71315

* Update Codicons: add 'magnet' icon
microsoft/vscode-codicons@4c61155

* Remove unused 'SettingSearch' issue type

* notebook document data loss.

* cell language should not be freezed.

* Add preferred_username to the list of msft token claims (microsoft#106511)

* debug: update js-debug

* fix microsoft#106430.

* hide outputs if it is transient.

* Add optional typing for webview state in WebviewPanelSerializer

This makes it easier for extensions to correctly type their state if they wish

* Add comment to WebviewViewResolveContext

* use optional chaining

* Use `Set` instead of array

Sets should offer faster checking to see if a property has been seen

* Create webview.web.contribution

Fixes microsoft#106516

Creates an explicit contribution file for web. This makes sure we only don't register the `IWebviewService` twice. Not 100% sure this fixes the issue since I couldn't repo the original bug with our oss builds

* Revert "API proposal for tree item icon color"

This reverts commit 52e557f.

* Skip formatting when during format-on-save, the configured formatter cannot be found (continue to show silent notification), microsoft#106376

* don't use renderCodicons any more, microsoft#105799

* remove old renderCodicons-function, rename renderCodiconsAsElement to renderCodicons

* NotebookEditorEdit-api changes, microsoft#105283

* WorkspaceEdit-api changes, microsoft#105283

* adopt notebook integration tests, microsoft#105283

* add NotebookCell#index, microsoft#106637

* fix delay issue for provideCodeLenses, microsoft#106267

* rename RunOnceScheduler#timeout to delay

* use debian stretch images (microsoft#106656)

* remove deprecated function calls

related to microsoft#103454

* workaround, maybe fix for microsoft#106657

* update search files

* debt - make class list utils functions so that @deprecated works for them

* fixes microsoft#106406

* notebook - when creating a notebook, check that no notebook with another viewtype exists

* fix bad classList usage

* add regression test for microsoft#106657

* fixes microsoft#86180

* fixes microsoft#100172

Co-authored-by: Alex Ross <alros@microsoft.com>
Co-authored-by: Daniel Imms <daimms@microsoft.com>
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
Co-authored-by: isidor <inikolic@microsoft.com>
Co-authored-by: Christof Marti <chrmarti@microsoft.com>
Co-authored-by: Johannes Rieken <johannes.rieken@gmail.com>
Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
Co-authored-by: rebornix <penn.lv@gmail.com>
Co-authored-by: Rob Lourens <roblourens@gmail.com>
Co-authored-by: IllusionMH <illusionmh@gmail.com>
Co-authored-by: Daniel Imms <tyriar@tyriar.com>
Co-authored-by: Connor Peet <connor@peet.io>
Co-authored-by: Matt Bierner <matb@microsoft.com>
Co-authored-by: Jean Pierre <jeanp413@hotmail.com>
Co-authored-by: Peng Lyu <penlv@microsoft.com>
Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
Co-authored-by: Vyacheslav Pukhanov <vyacheslav.pukhanov@gmail.com>
Co-authored-by: Alex Dima <alexdima@microsoft.com>
Co-authored-by: João Moreno <mail@joaomoreno.com>
Co-authored-by: Miguel Solorio <miguel.solorio@microsoft.com>
Co-authored-by: SteVen Batten <steven.m.batten@outlook.com>
Co-authored-by: Jackson Kearl <jakearl@microsoft.com>
Co-authored-by: Rachel Macfarlane <ramacfar@microsoft.com>
Co-authored-by: Dirk Baeumer <dirkb@microsoft.com>
Co-authored-by: WhizSid <whizsid@aol.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Oleg Demchenko <oldemche@microsoft.com>
@smhc
Copy link

smhc commented Sep 15, 2020

Looks like a duplicate of #3585

@felipecrs
Copy link
Author

Looks like a duplicate of #3585

True, pretty much the same. I'll update the PR title and description to match #3593 (comment), so they'll be different.

@felipecrs felipecrs changed the title Use login shell for executing commands inside of containers New environment configuration file: /etc/devcontainer Sep 17, 2020
@felipecrs
Copy link
Author

felipecrs commented Sep 17, 2020

I rewrote this Issue.

@felipecrs
Copy link
Author

Another thing, BASH_ENV environment variable can be used to specify bash rc files that should run if not in interactive or login mode. So, one could set in Dockerfile like:

ENV BASH_ENV="/etc/devcontainer"
SHELL ["/bin/bash", "-c"]
RUN echo "/etc/devcontainer will be sourced"

As it's an ENV, it will remain in the container and it will be used even when "envProbe": "none" (which is the default). It will not affect the terminals opened inside of VS Code, as BASH_ENV does not get executed when in interactive mode. This means that it's still needed to do something like:

RUN printf '%s\n' '' 'test -f /etc/devcontainer && . /etc/devcontainer' | sudo tee /etc/bash.bashrc /etc/zsh/zshrc

@QAston
Copy link

QAston commented Jan 25, 2022

One problem with userEnvProbe is that it's not available for containers you attach to using attach to existing container option #6226 , /etc/devcontainer config file would potentially solve that.

@chrmarti
Copy link
Contributor

@QAston You can open the config file associated with the 'attach' container using F1 > Remote-Containers: Open Configuration File and add "userEnvProbe" to that. The default is "loginInteractiveShell".

@QAston
Copy link

QAston commented Jan 25, 2022

@chrmarti thanks, I didn't notice it because it's not documented in the reference: https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_attached-container-configuration-reference

@chrmarti
Copy link
Contributor

@QAston Thanks, opened a PR for the documentation. (microsoft/vscode-docs#5119)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality plan-review PM-highlighted item determined to be P1 or P2
Projects
None yet
Development

No branches or pull requests

7 participants