平时,我们登录系统的时候都没怎么注意,就像生活得要有乐趣,下面介绍一种一登陆就有动物欢迎语。如图:
主要是用到两个包,一个是fortune、一个是cowsay
1、安装cowsay
1)安装npm
yum -y install npm
2)安装cowsay
npm install -g cowsay
2、安装forturn
百度云下载地址:https://pan.baidu.com/s/1nS9ov3Gf2d9PJrSG8aIG6w
recode官网下载地址: https://centos.pkgs.org/7/centos-x86_64/recode-3.6-38.el7.x86_64.rpm.html
fortune官网下载地址:http://springdale.math.ias.edu/data/puias/7/x86_64/os/Addons/Packages/fortune-mod-1.99.1-17.sdl7.x86_64.rpm
安装:
rpm -i recode-3.6-38.el7.x86_64.rpm
rpm -i fortune-mod-1.99.1-17.sdl7.x86_64.rpm
3、在/etc/profile.d目录下,添加脚本 cow.sh
#!/bin/bash
fortune |cowsay
4、重新登录
5、Dockerfile
FROM docker.io/centos RUN yum -y install wget RUN wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz RUN xz -d node-v8.12.0-linux-x64.tar.xz RUN tar -xf node-v8.12.0-linux-x64.tar RUN ln -s /node-v8.12.0-linux-x64/bin/node /usr/local/bin/node RUN ln -s /node-v8.12.0-linux-x64/bin/npm /usr/local/bin/npm RUN npm install -g cowsay RUN ln -s /node-v8.12.0-linux-x64/bin/cowsay /usr/local/bin/cowsay RUN wget http://mirror.centos.org/centos/7/os/x86_64/Packages/recode-3.6-38.el7.x86_64.rpm RUN rpm -i /recode-3.6-38.el7.x86_64.rpm RUN wget http://springdale.math.ias.edu/data/puias/7/x86_64/os/Addons/Packages/fortune-mod-1.99.1-17.sdl7.x86_64.rpm RUN rpm -i /fortune-mod-1.99.1-17.sdl7.x86_64.rpm