2

I just want to edit some files, can I have a text editor? Anything but Vi[m].

Is there a trivial way to install nano, emacs or a basic text editor?

Salim Fadhley
  • 6,975
  • 14
  • 46
  • 83

3 Answers3

4

Just switch your console to debian (or ubuntu, centos, fedora, alpine whichever you like).

And install your favorite editor, using package system like "apt".

(If you use CoreOS, @Behroozam's answer is correct.)

I think "switchable console" is knockout feature of the RancherOS. (I switched from CoreOS, because of this.)

Default console is a busybox, and I think most of RancherOS user doesn't use default console, unless you just deploy your docker apps using provisioning tools and never login to the console manually.

RancherOS's console is a system-docker container and it just launches sshd. So, in general you don't have to worry about memory usage.

I use & recommend debian console because of low disk usage, and my taste.

But you can choose any console unless you are running RancherOS on Raspberry Pi ;-)

benok
  • 688
  • 1
  • 6
  • 21
2

you can run full privilege nano docker container inside rancheros like this touturial . for example its should be something like this

echo 'docker run --rm inutano/nano:0.1 nano $@' > /usr/bin/nano && chmod +x /usr/bin/nano
Behroozam
  • 139
  • 1
  • 4
0

I'm sorry Behroozam, but your answer didn't work. However, I changed consoles but no luck on nano. VI is hardcore text editor that I am nervous of using, I guess if I want to get stuff done I'll have to bite the bullet and use VI.

  • 2
    Belay that... changing consoles actually worked. Installation of nano complete. At first threw an error that it could not find the nano package. Then it did. Life made easy with nano. Don't get me wrong VI is hard core and I respect anyone that uses it. – MagicCamera Dec 03 '19 at 01:35
  • I just tried switching console to debian using `sudo ros console switch debian` then running logging back to the machine. On debian you have `apt` package manager, so I did `sudo apt update` then `sudo apt install nano` – Karlo Medallo Feb 19 '20 at 18:19