chromebookへのlinuxインストール、設定の続き(その1はこちら)。
1. code-server
参考: https://note.com/digzero/n/n70ee0402a92b
プロまでつかう最強エディタvscode。code-serverは、これをブラウザ上で再現した
もの。vscodeは非常に優秀で大好きだが、vscodeは日本語との相性が極めて悪く、
windowsでも、等幅フォントを選んでも何してもどうしても入力が飛んでしまい、
codingのみで、普通のテキストエディタとしては使えていない。
chromebookでもあともう少し!という感じなので、emacsやvimと併用中。
■インストール
# aptをアップデートして、curlでインストール
> sudo apt update && sudo apt upgrade -y
> curl -fsSL https://code-server.dev/install.sh | sh
# 自動で起動するように設定(毎回code-serverを起動しても良い。)
> sudo systemctl enable --now code-server@$USER
code-serverを起動した状態で、ブラウザで
http://127.0.0.1:8080
にアクセスすると、coderを立ち上げられる。初回起動時にはパスワードの入力を求められる。
このパスワードは、
~/.config/code-server/config.yaml
に格納されているので、
> cat ~/.config/code-server/config.yaml
などで確認し、記載されているパスワードを入力する。
■PWA
Chromeのままでは、ショートカットがconflictするなどの障害があるため、PWA化したほうが使いやすい。127.0.0.1:8080にアクセスした状態でクロームの設定メニューを開き「code-serverで開く」を選ぶ。PWAとしてインストールする確認画面が開くので、インストールする。
日本語化するために、Extention(Ctrl+Shift+Xでも可)を開き、
「Japanese Language Pack for Visual Studio Code」
をインストール。
■ショートカット
お好みのショートカットに。ここではvim。同様にExtentionアイコンからvimを検索し、 インストール。PWA化せずにこれをブラウザ内でやろうとすると、chromeのショートカットとバッティングしていらいらすることになる。「Japanese Language Pack for Visual Studio Code」
をインストール。
■ショートカット
お好みのテーマに変更。左下のギザギザアイコンから、配色テーマを選ぶ。
code-serverでは、デフォルト以外のテーマが反映できないかも。
code-serverでは、デフォルト以外のテーマが反映できないかも。
2. Docker
https://qiita.com/pyama2000/items/90b189964f71def53b19
# Dockerを以前にインストールしている場合はアンインストール
> sudo apt remove --purge docker docker-engine docker.io containerd runc
> sudo apt update -y
# 依存パッケージをインストール
> sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
# DockerのGPGキーを追加
> curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
> sudo apt-key fingerprint 0EBFCD88
# Dockerの安定版(stable)のリポジトリを追加
> sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
# Dockerをインストール
> sudo apt update -y
> sudo apt install -y docker-ce docker-ce-cli containerd.io
# インストールできたことを確認
> sudo docker run --rm hello-world
# 成功すると、以下のメッセージが表示。
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
現在のユーザにdockerグループを追加し一般ユーザの権限でも実行できるようにする。
# 現在のユーザのグループに`docker`を追加
> sudo usermod -aG docker `whoami`
# Chrome OSを再起動
> docker run --rm hello-world






No comments:
Post a Comment