📜  在 docker 映像中编辑文件 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:25.093000             🧑  作者: Mango

代码示例1
As in the comments, there's no default editor set - strange - the $EDITOR environment variable is empty. You can log in into a container with:

docker exec -it  bash
And run:

apt-get update
apt-get install vim
Or use the following Dockerfile:

FROM  confluent/postgres-bw:0.1

RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "vim"]
Docker images are delivered trimmed to the bare minimum - so no editor is installed with the shipped container. That's why there's a need to install it manually.