cd /bin
vi docker-tag
#!/bin/sh
repo_url=https://registry.hub.docker.com/v1/repositories
image_name=$1
#curl -s ${repo_url}/${image_name}/tags | json_reformat | grep name | awk '{print $2}' | sed -e 's/"//g'
curl -s ${repo_url}/${image_name}/tags | jq . | grep name | awk '{print $2}' | sed -e 's/"//g'
#添加执行权限
chmod +x docker-tag
#查看mysql所有tag
docker-tag mysql
curl 安装
1.源码安装
wget http://curl.haxx.se/download/curl-7.20.0.tar.gz
tar -zxf curl-7.20.0.tar.gz
cd curl-7.20.0
./configure
make && make install
2.apt-get
apt-get instal curl
jq 安装
1.源码安装
cd /usr/local/src
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz
tar zxvf jq-1.5.tar.gz
cd jq-1.5
./configure
make && make install
#测试
echo '{"yjt":"boy","age":20}' |jq .
2.apt-get
apt-get -y install jq