This is the third day article of Advent Calender on the 2019 code-server. This is a continuation of the second day. This time as well, I will explain what is code-server?
(1) What is code-server? (2) Create your own code-server environment with Docker (3) Try using VSCode Plugin (4) Let's prepare an MVC environment including DB etc. (1) (5) Let's prepare an MVC environment including DB etc. (2) (6) Let's prepare an MVC environment including DB etc. (3) (7) Let's prepare an MVC environment including DB etc. (4) (8) Let's prepare an MVC environment including DB etc. (5) (9) Let's prepare an MVC environment including DB etc. (6) (10) Bonus
(NEXT->) Online environment version 1st day Improve the work environment
(..) To build locally including environment such as DB (..) How to put it online? (..) How to work with the latest trendy environment such as K8S? (..) I want to modify Code-Server to make it better
You can use the vscode plugin. You will be able to easily write programs by using auxiliary functions such as autocomplete and refactoring functions.
Let's create it with python.
FROM python:3.8.0-buster
RUN apt-get update
# code-Install wget to get the server
RUN apt-get install -y wget
#Working directory/Make it works. Anywhere is fine
WORKDIR /works
# code-Get the server binary
RUN wget https://github.com/cdr/code-server/releases/download/2.1692-vsc1.39.2/code-server2.1692-vsc1.39.2-linux-x86_64.tar.gz
# code-server/Unzip under works
RUN tar -xzf code-server2.1692-vsc1.39.2-linux-x86_64.tar.gz -C ./ --strip-components 1
WORKDIR /works/app
ENV PYTHONPATH=/works/app
#Install python plugin
RUN /works/code-server --install-extension ms-python.python
RUN /usr/local/bin/python -m pip install -U pylint --user
#The default is/works/Make it start with app.
CMD [ "/works/code-server", "--allow-http", "--auth", "none", "--port", "8443", "/works/app"]
I could have installed python on ubuntu, but I am using the official python image.
I have installed the plugin for python as RUN / works / code-server --install-extension.
The root folder is specified by specifying PYTHONPATH.
docker build -t cs03 .
docker run -v "$PWD:/works/app" -p "8443:8443" -it cs03
Open a browser and write something
Oh, the complement is working !!
Let's distribute the created Image. Once created, the Image can be moved in almost the same state.
PS
https://github.com/kyorohiro/advent-2019-code-server
Recommended Posts