Search code examples
visual-studio-codedockerfilevscode-remote

write "message of the day" by images used by vscode remote development


I am using remote development extension in vscode with a Docker image and I would like that when I start it in the console I want to see the message of the day "motd".

The Dockerfile in .devcontaier has this at the end:

COPY motd /etc/
... # change the default user and WORKDIR
CMD cat /etc/motd && /bin/bash

If I run manually this image I see the message but when vscode uses it I don't see it in the console.


Solution

  • The best solution I found so far is

    RUN echo "cat /etc/motd" >> $HOME/.bashrc
    CMD /bin/bash