[LINUX] Install and develop Git, VSCode, Docker on Chrome OS

Introduction

On Black Friday this year, Google Pixel Slate will get a $ 350 discount with a genuine keyboard + Pixelbook Pen for free. As a Google believer, I decided to buy it because I couldn't afford to miss this opportunity. The Pixel Slate is a Google Chrome OS tablet that's 12.3 inches, a bit larger for a tablet, but a good size for a 2 in 1 tablet. It weighs about 700 grams, which is heavier than the iPad Pro, but can be said to be easy to carry. As the name implies, this Chrome OS is a very lightweight OS that is supposed to work mainly on the Chrome browser, but you can also use Android and Linux apps. So I wanted to develop it lightly with Chrome OS, so I will summarize the work contents at that time.

spec

Pixel Slate

--Processor: 8th Generation Core i5

** OS version **

Linux setup

You can install Linux command line tools, code editors, and IDEs on Chrome OS. However, it is off by default and must be enabled in the settings.

From the settings [** Linux (Beta) ]> [ Turn on **]

Screenshot 2019-12-23 at 15.24.43.png

After a while to set up, a terminal window will pop up so you can use Linux. At the moment this feature is in beta and may cause problems, but I think it's something you can solve yourself.

Terminal setup

Settings for the terminal itself

With the terminal up, press Ctrl + Shift + p to display the setting screen. Screenshot 2019-12-23 at 12.25.37.png

Package update

Run the following command to keep the package up to date.

$ sudo apt update -y
$ sudo apt upgrade -y
$ sudo apt full-upgrade -y

Update Git to the latest version

The version of git installed by default is 2.11.0, so update to the latest version.

There are two methods, one is to download the source and install it, and the other is to clone the repository and install it. The installation location is specified by prefix = / usr / local, but there is no problem if you install it in any location you like (*** if it is in the PATH).

[Common] Install dependent packages

$ sudo apt install -y autoconf gettext libcurl4-gnutls-dev libexpat1-dev libghc-zlib-dev libssl-dev make

1. Update from repository to latest version

If you always want to update to the latest version, you can easily install and update by cloning the repository.

** Install git **

$ git clone https://github.com/git/git.git ~/git
$ cd ~/git
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

** git update **

$ cd ~/git
$ git pull origin master
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

2. Download and update the source

If you don't want to use the latest version of git, you can use this method to specify the version and download the source. Check the latest version from the git release page. The latest version ** v2.24.1 ** is used here, but other versions are fine.

FireShot Capture 002 - Releases ยท git_git - github.com.png

Run the following command to download the git source.

# v2.24.Replace 1 with the downloaded version
$ wget https://github.com/git/git/archive/v2.24.1.tar.gz
$ tar -zxf v2.24.1.tar.gz
$ cd git-2.24.1

All you have to do is install it using the make command.

$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

Install Visual Studio Code

Since I usually develop with Neovim and Visual Studio Code (VS Code), I will make it available on Chrome OS. You can start VS Code by running the Debian installer (.deb) downloaded from the Official Site.

Screenshot 2019-12-23 at 14.16.35.png

Install Docker related tools

Even though Linux on Chrome OS runs on a VM, I want to run it with a minimum of applications, and Docker is indispensable for development, so install Docker and Docker Compose.

Install Docker

If you install it according to the Official page, it will not fail.

#Uninstall if you have previously installed Docker
$ sudo apt remove --purge docker docker-engine docker.io containerd runc

$ sudo apt update -y
#Install dependent packages
$ sudo apt install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \
    software-properties-common

#Added Docker GPG key
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88

#Stable version of Docker(stable)Add repository for
$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"

#Install Docker
$ sudo apt update -y
$ sudo apt install -y docker-ce docker-ce-cli containerd.io

#Confirm that it was installed
$ sudo docker run --rm hello-world

Run Docker without sudo

If this is left as it is, it is necessary to sudo every time Docker is executed, so add a docker group to the current user so that it can be executed with the privileges of a general user.

#In the current group of users`docker`Add
$ sudo usermod -aG docker `whoami`
#Restart Chrome OS
$ docker run --rm hello-world

Install Docker Compose

This is also installed according to the procedure on the Official Site.

#Download the latest version of Docker Compose
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#Change permissions to run
$ sudo chmod +x /usr/local/bin/docker-compose
#Confirm that Docker Compose has been installed
$ docker-compose --version

in conclusion

I touched Chrome OS for the first time, but it is very interesting that I can use the Android application and operate it intuitively with the Pixelbook Pen. Linux is also a beta version, but it is not bad to use, and I felt that it could be used as a development environment without any problems. However, since the storage is only 128GB, it will be necessary to use external storage or cloud services.

reference

-[[#ChromeOS] Set up Chromebook as a development environment for Go language / Visual Studio Code using Crostini (Linux container) #Chromebook #Go language #golang #golangjp #VSCode #Environment construction --Qiita](https: // qiita.com/kukita/items/b673bf6eba2cc91fc545) -Set up development / writing environment with Chromebook Flip C101PA (January 2019 version) --Qiita -Example of customizing Linux on Chromebook for software developers --Qiita -Chromebook Linux development environment construction --Qiita -ChromeOS keyboard shortcut --Qiita

Recommended Posts

Install and develop Git, VSCode, Docker on Chrome OS
Install docker on Fedora31
Install Docker on AWS
Install Python 3.6 on Docker
How to install Git GUI and Gitk on CentOS
Install Docker on Arch Linux and run it remotely
Install Chrome on CentOS 7 series
Install Docker on WSL Ubuntu 18.04
Install Python 3.8 on Ubuntu 18.04 (OS standard)
raspberry pi 4 centos7 install on docker
Install Mecab and mecab-python3 on Ubuntu 14.04
Install and run dropbox on Ubuntu 20.04
Install Adopt OpenJDK 11 on Cent OS 8
Install OpenCV and Chainer on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install Sphinx on Mac OS X
Build and install OpenCV on Windows
Install Scipy on Mac OS Sierra
Quickly install OpenCV 2.4 (+ python) on OS X and try the sample
Install mitmproxy on Mac OS X
Install fabric on Ubuntu and try
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install lp_solve on Mac OS X and call it with python.
Compile and install Git from source.
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
Install easy_install and pip on windows
Install pgmagick on Mac OS X 10.9
Install matplotlib on OS X El Capitan
docker and PyCharm under proxy on windows
Install wsl2 and master linux on windows
Building a LaTeX environment on Chrome OS
Link WAS and FLASK applications on docker
Install and launch k3s on Manjaro Linux
Install miniconda on chromebook (using chromebrew + git)
Install 64-bit OS (bate) on Raspberry Pi
Install docker-compose on 64-bit Raspberry Pi OS
Dockerfile: Install Docker on your Linux server
Install Puppet Master and Client on Ubuntu 16.04
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
Install VScode on Lenovo IdeaPad Duet Chromebook
Install pyenv and rbenv on CentOS system-wide
Install matplotlib and display graph on Jupyter Notebook
Develop and deploy Python APIs using Kubernetes and Docker
Python development flow using Poetry, Git and Docker
Install docker mongodb image and connect from spring-boot
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Install pip and pandas with Ubuntu or VScode
DISPLAY error in wxPython (and traitsui) on vscode
Install MongoDB on Ubuntu 16.04 and operate via python
Install Python and libraries for Python on MacOS Catalina
Install ZIP version Python and pip on Windows 10