Create a VS Code + Docker development environment on a Linux VM

Since VS Code's Remote (Container) plugin was convenient, I tried to build a development environment on the VM.

I can't install Docker straight on a Windows VM (Hyper V option is disabled on guest OS).

So, I made it possible to use remote desktop with Linux VM and built a development environment.

1. VM preparation

--Create a VM on Cent OS 7.

(If you build the environment with Cent OS 8 in the following procedure, you can connect with RDP immediately after setup, but after restarting, there was a problem that neither SSH nor RDP could be connected to the VM, so I tried again)

2. Set up Remote Desktop

--Ssh connect to the VM and switch to the Root user.

  sudo su - 

--Refer to the following site and install the RDP package. Connect to a Linux instance in the cloud using RDP on Windows --Qiita

--Create a user for RDP. Add to sudo list as needed.

$ useradd sampleuser  
$ passwd sampleuser 
$ usermod -aG wheel sampleuser

-Changed the default look (if you like) from GNOME Classic to GNOME

echo 'DESKTOP="GNOME"' >> /etc/sysconfig/desktop
systemctl restart gdm.service

3. Connect to VM with Remote Desktop

Connect to the VM using the Remote Desktop app.

4. Install Visual Studio Code

-Download the rmp file from Official Site and install it with yum

cd ~/path/to/download/
sudo yum install code-1.42.0-1580986751.el7.x86_64.rpm

--Install the Remote (Conteiner) plugin Search for the "Remote (Conteiner)" plugin on VS Code and install it.

5. Install Docker

--Install Docker by referring to the following site

Install Docker on CentOS 7

--Add users to Docker group

$  usermod -aG docker sampleuser

6. Run Docker with VS Code

--Click the "+" button in the "Remote Explorer" tab --Select "Open Folder in Container" and select a blank folder --Select and run the "Python 3" container --Launches a container that can execute Python 3 code

image.jpeg

Reference: When ssh key authentication fails with git in the container

--Git fetch once at the terminal of the container --Once you answer yes to the question of whether to connect to the host, it will be cured.

Open ssh repository in container fails with host key verification · Issue #2087 · microsoft/vscode-remote-release · GitHub

Recommended Posts

Create a VS Code + Docker development environment on a Linux VM
Create a simple Python development environment with VS Code and Docker
Create a Linux environment on Windows 10
Create a Python environment for professionals in VS Code on Windows
Create a Python virtual development environment on Windows
Create a Python development environment on Windows (Visual Studio Code remote WSL).
Steps to create a Python virtual environment with VS Code on Windows
Create a QR code for the URL on Linux
Create a comfortable Python 3 (Anaconda) development environment on windows
Create a Python development environment on OS X Lion
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
Linux beginners create Ubuntu 16.04 environment on Docker (for Mac)-first half-
Create a Python environment on Mac (2017/4)
Create a python environment on centos
[Linux] Docker environment construction on Redhat
Create a simple Python development environment with VSCode & Docker Desktop
[Django] Use VS Code + Remote Containers to quickly build a Django container (Docker) development environment.
Create a development environment for Go + MySQL + nginx with Docker (docker-compose)
Create a Docker container image with JRE8 / JDK8 on Amazon Linux
Create a python environment on your Mac
[Linux] Build a jenkins environment with Docker
Create a Linux virtual machine on Windows
[Linux] Build a Docker environment with Amazon Linux 2
Build a LAMP environment on your local Docker
[Python] Build a Django development environment with Docker
Build a development environment using Jupyter and Flask with Python in Docker (supports both VS Code / code-server)
Build a Python development environment on your Mac
[Venv] Create a python virtual environment on Ubuntu
Try to create a new command on linux
Build a Kubernetes environment for development on Ubuntu
[Note] How to create a Ruby development environment
Set up a Python development environment on Marvericks
Set up an Objective-C 2.0 development environment on Linux
Use Docker development container conveniently with VS Code
Create a Python execution environment on IBM i
Build a mruby development environment for ESP32 (Linux)
[Docker] Create a jupyterLab (python) environment in 3 minutes!
[Note] How to create a Mac development environment
Build a Python development environment on Raspberry Pi
Build a python execution environment with VS Code
Set up TinyGo development environment for VS Code
Create a Python development environment in 10 minutes (Mac OS X + Visual Studio Code)
Cross-compiling Raspberry Pi and building a remote debugging development environment with VS Code
Python local development environment construction template [Flask / Django / Jupyter with Docker + VS Code]
Introduce VS Code and Remote Development to an offline environment to make linux development comfortable
How to run a Django application on a Docker container (development and production environment)
Create a Python environment
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Build a Django development environment using pyenv-virtualenv on Mac
Build a local development environment for Laravel6.X on Mac
Notes on creating a python development environment on macOS Catalina
Create a python development environment with vagrant + ansible + fabric
Build a GVim-based Python development environment on Windows 10 (1) Installation
How to build a Django (python) environment on docker
Build a Python development environment on Mac OS X
Create an environment for MkDocs on Amazon Linux (attempted)
Build a Python development environment using pyenv on MacOS
Create a decent shell and python environment on Windows
Build a development environment with Poetry Django Docker Pycharm
How to build a Python environment on amazon linux 2
Cross development environment (developing programs for windows on linux)