64位系统安装踩搞不少,很多apt都装不了,只能看官方有没有deb包,实在不行就需要编译安装。
可以从这里找docker的包
https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/
需要下载这三个 wget xxx
docker: 23 items found.
64位系统安装踩搞不少,很多apt都装不了,只能看官方有没有deb包,实在不行就需要编译安装。
可以从这里找docker的包
https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/
需要下载这三个 wget xxx
健康检查 (HEALTHCHECK
) 指令告诉 Docker 如何检查容器是否仍在工作。 它能够监测类似一个服务器虽然服务进程仍在运行, 但是陷入了死循环, 不能响应新的请求的情况。
当一个容器有指定健康检查 (HEALTHCHECK
) 时, 它除了普通状态之外, 还有健康状态 (health status
) 。 健康状态的初始状态是正在启动 (starting
) , 一旦通过了一个健康检查, 它将变成健康 (healthy
) (不管之前的状态是什么), 经过一定数量的连续失败之后, 它将变成不健康 (unhealthy
) 。
1 check the latest docker-compose version
https://github.com/docker/compose/releases
2 run the command
curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
3 here we go.
docker-compose --version
in10环境,安装的VMware Workstation Pro,创建了一台Centos7.x的虚拟机。并启用虚拟化。
// v1.16.0版本可以从这里查 https://storage.googleapis.com/kubernetes-release/release/stable.txt
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
上述如果在墙内,需要http代理可以,先将代理设为环境变量 export http_proxy=http://ip:port
也可以从github上下载
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#client-binaries-1
找到Current release如 https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md
再找到Client Binaries如v1.16.0下的 https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md#client-binaries
再找到合适的tar包如 https://dl.k8s.io/v1.16.0/kubernetes-client-linux-amd64.tar.gz
wget https://dl.k8s.io/v1.16.0/kubernetes-client-linux-amd64.tar.gz
tar -zxvf kubernetes-client-linux-amd64.tar.gz
cd kubernetes/client/bin
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
找出tag为<none>
的
docker images -f "dangling=true"
找出tag为<none>
的, 只返回image id
docker images -f "dangling=true" -q
根据repository名称和tag模糊过滤,我验证时,如果repository有/
或小数点符号,通过*
是无法匹配的
docker images --filter=reference='busy*:*libc'
使用before
或since
根据时间查找,实际上以repository的名字作为时间分隔,
docker images --filter "before=image1"
docker images --filter "since=image3"
此外还有label, label=<key>
or label=<key>=<value>
docker images --filter "label=com.example.version"
, 这条我用docker image inspect <image id>
,发现几个image的label都是空的,这个有待研究。
话说本地用docker-compose搭了个wordpress的站点,设置里site url和home都是本地地址http://localhost:8300 ,然后上线的数据库数据是导出后导入进来。
用nginx反向代理wordpress的容器地址,浏览器卡住半天自动跳转到www.xxx.com:8300, 这很诡异啊,一直在怀疑是不是nginx配错了,proxy_redirect是off的。 即使重新安装nigix也无济无事。 curl -i 看看响应头确实301跳转了
There is no docker untag command, so, the answer is find the repository which using the image and execute
docker rmi <REPOSITORY>:<TAG>
There are the commands we executed before to tag a new image with an image id
docker tag <image id> hkccr.ccs.tencentyun.com/xxx/fff:v0.1.4
And remove the tagged image
docker rmi hkccr.ccs.tencentyun.com/xxx/fff:v0.1.4
Error like this:
Collecting misaka==2.1.1 (from -r requirements.txt (line 12))
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fa/87/b1020510a00aba1b936477e54180b143df654c565b84936b0b3e85272cf2/misaka-2.1.1.tar.gz (125kB)
ERROR: Complete output from command python setup.py egg_info:
ERROR:
No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)
Trying to continue anyway. If you are trying to install CFFI from
a build done in a different context, you can ignore this warning.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/usr/local/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/local/lib/python3.7/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/local/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
And my Dockerfile is here:
version: '3.1'
services:
web:
build: .
restart: always
ports:
- 8080:80
environment:
MONGODB_HOST: mongodb
MONGODB_USER: root
MONGODB_PWD: 123456
depends_on:
- mongodb
mongodb:
image: mongo:4.1
restart: on-failure
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 123456
volumes:
- ./data/mongo:/data/db
- ./data/mongo-entrypoint/:/docker-entrypoint-initdb.d/
对于容器的配置文件, docker-compose的还好理解,但是一到k8s,就有很多对象, pods, nodes, services, deployment... 每个基本上都有个yml的定义,其中的参数一看一脸茫然。
还好找到这个:kubectl explain xxx
可以看它的定义
如kubectl explain service --recursive
可以查看service定义的所有定段。
如kubectl explain svc.metadata.uid
可以查看某个字段的定义
当然,k8s官方也有一些examples: https://github.com/kubernetes/examples