Help us understand the problem. What is going on with this article?

Docker — docker コンテナの中で vim が使えない場合

How to

OSの種類次第でインストール方法が変わる。

root ユーザーで 以下のどれか を実行すれば、だいたいイケるはず。

Ubuntu系

apt-get update
apt-get install vim

Centos系

yum install vim

Alpine

apk update
apk add vim

Busybox

パッケージ管理ツールがそもそもない?

Dockerfile

Dockerfile に記述しておく場合は、以下のような感じ。 (apt-getの場合)

FROM ubuntu

RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "vim"]

経緯

  • 「vi さえ入ってない環境」ってのを初めて触ったので、一瞬どうすれば良いか戸惑った。

補足

  • Centos だと vi コマンドで vim が使えたりすることが判明。
  • alipine だと vi が使えたりすることが判明。( vim じゃないので辛い )

環境

  • Docker version 17.03.0-ce, build 60ccb22
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした