Alpine Linux dockerfile 安装vim命令

300 阅读1分钟

缺少vim编辑功能,dockerfile中进行安装

查看系统信息

cat /etc/os-release

    
    NAME="Alpine Linux"
    ID=alpine
    VERSION_ID=3.8.1
    PRETTY_NAME="Alpine Linux v3.8"
    HOME_URL="http://alpinelinux.org"
    BUG_REPORT_URL="http://bugs.alpinelinux.org"
    

1、优先解决镜像源问题,设置成国内镜像源

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

2、安装软件

# vim 不支持中文显示
RUN apk add --no-cache  vim
# 支持中文显示
RUN apk add --no-cache  neovim

apk安装时一定要加上 --no-cache ,以免出现报错