3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RancherOSでもvimしたい!

Last updated at Posted at 2018-12-22

こうなる前に。

How

$ sudo vi /etc/profile.d/vim.sh
$ source /etc/profile.d/vim.sh
/etc/profile.d/vim.sh
alias vim='docker run -it --rm -v $HOME:/root -v $PWD:/work -w /work thinca/vim:latest'

このvimにできないこと

  • 開けるファイルはカレントディレクトリ(と$HOME)のみ。sudo vim /etc/...とかできないです。
  • :terminalはおそらく意図通りの動きをしないです。コンテナ内なので。

コード化したいときは

cloud-configでwrite_files使う。

$ sudo vi /var/lib/rancher/conf/cloud-config.d/user_config.yml
/var/lib/rancher/conf/cloud-config.d/user_config.yml
# cloud-config
...(snip)...
write_files:
  - container: console
    path: /etc/profile.d/vim.sh
    permission: "0644"
    owner: root:root
    content: |+
      alias vim='docker run -it --rm -v $HOME:/root -v $PWD:/work -w /work thinca/vim:latest'
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?