microsoft / vscode-dev-containers

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!
https://aka.ms/vscode-remote
MIT License
4.72k stars 1.41k forks source link

Debian / Ubuntu base conda-notice.txt error #1617

Closed dmaasland closed 2 years ago

dmaasland commented 2 years ago

Issue

Hello,

It seems that the base Debian / Ubuntu images add the following code to /etc/bash.bashrc and /etc/zsh/zshrc:

if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
    cat "${DEV_CONTAINERS_DIR}/conda-notice.txt"
    mkdir -p "$HOME/.config/vscode-dev-containers"
    ((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &)
fi

However, the file ${DEV_CONTAINERS_DIR}/conda-notice.txt isn't present by default and triggers an error when opening a terminal for the fist time:

cat: /conda-notice.txt: No such file or directory
vscode ➜ /workspaces/condabug $

Additional information

Steps to Reproduce:

  1. Create a devcontainer using the following config files below
  2. Open up a new bash terminal window
  3. Observe the warning cat: /conda-notice.txt: No such file or directory

Dockerfile

ARG VARIANT=bullseye
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}

devcontainer.json

{
  "name": "Conda warning test",
  "build": {
    "dockerfile": "Dockerfile"
  },
  "remoteUser": "vscode"
}

Workaround

Add

ENV IGNORE_NOTICE=true

to your Dockerfile

Impact

Very low, it only manifests on first startup of the terminal.

Chuxel commented 2 years ago

@samruddhikhandale @joshspicer Is this a regression for https://github.com/devcontainers/images/tree/main/src/anaconda ?

samruddhikhandale commented 2 years ago

Fix - https://github.com/devcontainers/features/pull/135

samruddhikhandale commented 2 years ago

@dmaasland thanks for raising the issue, the upstream error is now fixed. Feel free to re-open the issue if needed.