习惯于从Oracle的github站点下载dockerfile,修改后生成自己所需的镜像。但是最近有个项目,自己生成镜像文件后发现磁盘居然满了,连容器都没法跑起来。查了一下镜像占用的磁盘空间,一下子被数字吓到了。


$ docker images

REPOSITORY TAG IMAGE ID CREATED SIZE


1c98d8816e19 About an hour ago 3.57GB


localhost/oracle/soasuite 12.2.1.3 078faf1a877d 7 days ago 13.5GB


oracle/fmw-infrastructure 12.2.1.3 d37d67bf7981 8 days ago 5.56GB


oracle/database 18.3.0-ee d9b807a62d9b 2 weeks ago 18GB

被动辄10几个G镜像,这容器怎么跑。但是为了项目可以快速测试,也只能想办法减少镜像的尺寸。看到github上有人吐槽这个问题,O记的工程师建议是去Oracle Container Registry上pull镜像。

去https://container-registry.oracle.com看了一眼,发现同样的image确实要小很多。于是从善如流,决定pull镜像下来用。

先login到站点


docker login container-registry.oracle.com

输入用户名密码后,运行pull镜像命令,连续试了几次都是报了镜像not found: does not exist or no pull access的错。

查了老半天原因,最后发现原来坑爹的O记是需要在Oracle Container Registry的页面上接受协议,才能有下载到镜像。

登录网站,在你需要下载的镜像页面点击协议,在弹出窗口接受协议,然后页面会显示当前用户协议的有效时间。再到系统里用命令pull镜像,正常下载。

一无聊又搞事情,把一台CentOS机器直接从6升级到7,结果升级后要安装东西时,用yum update出现了错误,显示python(abi) = 2.6 is needed by (installed) python-argparse-1.2.1-2.el6.centos.noarch。

放狗搜了半天,试了几种方法还是搞不好。仔细分析具体信息,应该是系统残留的CentOS6包导致的,删除所有的el6包解决问题。

rpm --erase --nodeps $(for pkg in $(rpm -qa | grep '\.el[56]\.' | grep -v kmod | grep -v kernel); do rpm -q $pkg --qf '%{NAME} ' ; done)

最近开始把VS Code做为主力代码编辑器,结果在MAC上每次打开总提示

Git installation not found.

没有就装呗,打开Console,Git显示

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

重装Xcode command line tool解决

xcode-select  --install