This is the first day of my participation in the August More Text challenge
If ❤️ my article is helpful, welcome to like, follow. This is the biggest encouragement for me to continue my technical creation. More previous articles in my personal column
Install vim problem record in Docker container
The beginning of the story
Many Internet companies, business after 0-1 savage growth must need fine management; Especially for your own users, you need to be like a cheating man who knows how to make your users happy. They’re the ones who follow you like hell.
If it is for enterprise users (to B), the problem is simple: visit different partner companies/industry leaders, everyone has a purpose, mutual benefit is clear;
But for users like us, to C users, if a random sample of users are invited to the company; Coupon survey; Apart from one-off, is the sample user data representative? Are the user questions the current direction of the team?
So recent work adds another layer to the existing business analysis: user tags. Mark user behavior in your application, analyze user characteristics, usage habits
In the middle process, big data is needed, so I choose to use Docker to build the environment for testing and development by myself. During the process, I encountered problems in viM installation
Install vim to edit hadoop-hive.env
Install hive image using Docker on centos 7
$ docker ps
CONTAINER ID IMAGE COMMAND PORTS NAMES
dc387ff5c56d bde2020/hive:2.1.0-postgresql-metastore "Entrypoint. Sh/bin /..."0.0.0.0:10000->10000/ TCP, 10002/ TCP hive-server $dockerexec -it dc387ff5c56d /bin/bash
# vim edit hadoop-hive.env
/opt# vi hadoop-hive.env
bash: vi: command not found
# Mirror purity is understandable, compile and install it
/opt# yum install vim
bash: yum: command not found
/opt# rpm
bash: rpm: command not found
# curl
/optWget # http://yum.baseurl.org/download/3.2/yum-3.2.28.tar.gz
bash: wget: command not found
/opt# rz
bash: rz: command not found
/opt# curl
curl: try 'curl --help' or 'curl --manual' for more information
/opt# curl - yum - o 3.2.28. Tar. Gz http://yum.baseurl.org/download/3.2/yum-3.2.28.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 864k 100 864k 0 0 276k 0 0:00:03 0:00:03 --:--:-- 667k
You are too pure
/opt# tar ZXVF - yum - 3.2.28. Tar. Gz/ opt/yum - 3.2.28# ls
AUTHORS ChangeLog INSTALL PLUGINS TODO callback.py docs output.py rpmUtils testyum yum.spec yummain.py COPYING FAQ Makefile README bin cli.py etc po shell.py utils.py yum-updatesd.py yumcommands.py / opt/yum - 3.2.28# make
bash: make: command not found
Copy the code
Bash: make: command not found Not even a make command. Are containers all this wild now
It’s Debian instead of flash
The mirror is not centos 7
Check the Linux kernel version/ opt/yum - 3.2.28# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="Seven"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1. 31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
Copy the code
PRETTY_NAME=”Debian GNU/Linux 7 (Wheezy)” Let me check the apt-get installation command
/ opt/yum - 3.2.28# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
E:
Copy the code
Unable to locate package vim in China is usually caused by the need to turn over the wall of apt-get source used by Debian abroad. Configure the domestic mirror
# back up the original 'apt-get' source file and configure it
/# mv /etc/apt/sources.list /etc/apt/sources.list.bakDeb http://mirrors.163.com/debian/ Jessie main non - free contrib/opt/yum - 3.2.28# echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list/ opt/yum - 3.2.28# echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list/ opt/yum - 3.2.28# echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list/ opt/yum - 3.2.28# echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
# Update apt-get, install vim/ opt/yum - 3.2.28# apt-get update/ opt/yum - 3.2.28# apt-get install vimReading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libc6 vim-common vim-runtime Suggested packages: glibc-doc locales ctags vim-doc vim-scripts The following NEW packages will be installed: vim vim-common vim-runtime The following packages will be upgraded: libc6 1 upgraded, 3 newly installed, 0 to remove and 179 not upgrade. Need to get 10.8 MB of archives. After this operation, 29.6 MB of additional disk space will be used. Do you want tocontinue [Y/n]? y
Copy the code
Other methods
Other than that, if it’s just a simple configuration file replacement. Env file docker cp hadoop-hive.env dc387ff5c56d:/opt copy the file to the specified folder in the container.
conclusion
Docker image installation is the need to pay attention to the system version kernel; Incorrect version/version number and docker do not match container problem