zoukankan      html  css  js  c++  java
  • 小知识:Docker环境缺少vi命令,如何解决

    docker exec可以使用--user参数指定root用户,进入安装vi即可:

    [opc@oci-001 ~]$ docker exec -it --user root testdb bash
    bash-4.2# vi
    bash: vi: command not found
    bash-4.2# yum install vi
    Loaded plugins: ovl
    ol7_UEKR5                                                                                                                                                    | 3.0 kB  00:00:00
    ol7_latest                                                                                                                                                   | 3.6 kB  00:00:00
    (1/5): ol7_UEKR5/x86_64/updateinfo                                                                                                                           | 186 kB  00:00:00
    (2/5): ol7_latest/x86_64/group_gz                                                                                                                            | 136 kB  00:00:00
    (3/5): ol7_latest/x86_64/updateinfo                                                                                                                          | 3.4 MB  00:00:00
    (4/5): ol7_UEKR5/x86_64/primary_db                                                                                                                           |  34 MB  00:00:01
    (5/5): ol7_latest/x86_64/primary_db                                                                                                                          |  37 MB  00:00:01
    Resolving Dependencies
    --> Running transaction check
    ---> Package vim-minimal.x86_64 2:7.4.629-8.0.1.el7_9 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ====================================================================================================================================================================================
     Package                                   Arch                                 Version                                              Repository                                Size
    ====================================================================================================================================================================================
    Installing:
     vim-minimal                               x86_64                               2:7.4.629-8.0.1.el7_9                                ol7_latest                               443 k
    
    Transaction Summary
    ====================================================================================================================================================================================
    Install  1 Package
    
    Total download size: 443 k
    Installed size: 914 k
    Is this ok [y/d/N]: y
    Downloading packages:
    vim-minimal-7.4.629-8.0.1.el7_9.x86_64.rpm                                                                                                                   | 443 kB  00:00:00
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : 2:vim-minimal-7.4.629-8.0.1.el7_9.x86_64                                                                                                                         1/1
      Verifying  : 2:vim-minimal-7.4.629-8.0.1.el7_9.x86_64                                                                                                                         1/1
    
    Installed:
      vim-minimal.x86_64 2:7.4.629-8.0.1.el7_9
    
    Complete!
    bash-4.2# vi
    bash-4.2#
    
    AlfredZhao©版权所有「从Oracle起航,领略精彩的IT技术。」
  • 相关阅读:
    2014年7顶级编程语言一个月
    Swift学习 --- 2.3和字符串
    自己写CPU第五级(4)——逻辑、实现移动和空指令
    读书笔记-互联网思维阅读10其中一本书《自由》
    Linux学习笔记——如何使用共享库交叉编译
    Vim识别编码
    linux RWT
    GConf 错误:联系配置服务器失败;某些可能原因是需要为 ORBit 启用 TCP/IP 联网
    Mysql 表忽略大小写~~
    andorid studio
  • 原文地址:https://www.cnblogs.com/jyzhao/p/15616535.html
Copyright © 2011-2022 走看看