添加logRotate
拉包
git clone ssh://gavinwei@git.example.com:29418/docker/base
修改脚本
1 2
| cd ~/base/ubuntu-py/src/main/docker cat logRotate.py
|
Docker
Docker, Python, container, lorote, percona, 工作笔记, 日志切割
Word Count: 737(words)
Read Count: 4(minutes)
镜像编译
以镜像percona为例,假如我们应用场景如下:
现在需要向pernoa镜像中添加数据库自动备份功能
下载镜像
1 2
| cd ~ git clone ssh://gavinwei@git.example.com:29418/docker/bd/percona
|
操作percona代码
1 2 3
|
pom.xml proguard.conf src
|
我们所需要操作都在src目录的最底层:
Docker
Docker, container, image, percona
Word Count: 349(words)
Read Count: 1(minutes)
安装ss5
apt-get install gcc make
下载源码包
1 2 3
| wget http://120.52.73.44/jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz cd ./ss5-3.8.9-8 ./configure
|
报错:
configure: error: *** Some of the headers weren't found ***
安装libpam0g-dev解决:
apt-get install libpam0g-dev
make报错:
1 2 3 4 5
| SS5OpenLdap.c:29:18: fatal error: ldap.h: No such file or directory #include <ldap.h> ^ compilation terminated. make[1]: *** [SS5OpenLdap.o] Error 1
|
解决:
apt-get install libcurl4-openssl-dev
Docker
ss5
Word Count: 1.2k(words)
Read Count: 6(minutes)
Docker容器部署的大致步骤如下:
一、在VM层的操作
镜像编译工作
在镜像项目的顶层目录下运行:
mvn versions:resolve-ranges
这一步用于获取base镜像的版本号
下一步进行镜像的编译:
mvn clean install
编译完成后,可使用docker images命令来查看所编译镜像是否存在
传输镜像
通过下面命令将编译好的镜像传输至DIND:
docker save docker.example.com/jira:0.0.1-SNAPSHOT | ssh -C root@dind1.docker.example.com "docker load"
Docker
DIND, Docker
Word Count: 419(words)
Read Count: 1(minutes)
解决fabfile中hosts变量的获取问题
test_depoly中使用_find_hosts_by_cluster_and_container(cluster,container)来获取hosts,但是传进来的这两个变量都有可能是列表,所以要解决列表问题,最后还要解决hosts列表中的元素为列表的情况
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| if type(containers) == str: hosts = map(lambda cluster: _find_hosts_by_cluster_and_container(cluster, containers), clusters) if type(containers) == list: hosts = [] for containers in containerss: host = map(lambda cluster: _find_hosts_by_cluster_and_container(cluster, container), clusters) hosts.extend(host) lst = [] for host in hosts: if type(host) == list: lst.extend(host) else: lst.append(host) hosts = lst print hosts
if len(hosts) == 0: env.hosts = None else: env.hosts = hosts
|
Docker
Docker, Python, fabfile, fabric
Word Count: 247(words)
Read Count: 1(minutes)