Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1059771
  • 博文数量: 186
  • 博客积分: 4939
  • 博客等级: 上校
  • 技术积分: 2075
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-08 17:15
文章分类

全部博文(186)

文章存档

2018年(1)

2017年(3)

2016年(11)

2015年(42)

2014年(21)

2013年(9)

2012年(18)

2011年(46)

2010年(35)

分类: LINUX

2015-01-22 18:26:53

  1. install docker on your Mac OSX, and then start it.

     

    ruby -e "$(curl -fsSL 
    brew install virtualbox boot2docker
    boot2docker init
    boot2docker up

  2. build the environment. 

    cat > Dockerfile <<\EOF
    FROM centos:centos6
     MAINTAINER xiaofu 
     RUN yum clean all
    RUN yum -y update && yum install -y \
    ruby-devel.x86_64 \
    ruby.x86_64 \
    rubygems.noarch \
    gcc.x86_64 \
    rpm-build.x86_64 \
   RUN gem sources -a \
 
       gem install fpm --no-rdoc --no-ri
EOF

 

  3. build the image.

docker build -t fpm_rpm .


  4. run the FPM in docker container. 

 

docker run -it --rm -v `pwd`/data:data fpm_rpm \
    fpm \
    --verbose \
    -f \
    -s dir \
    -t rpm \
    --name slow_query_converter \
    -v 0.9.2 \
    --config-files opt/slow_query_converter/conf/ \
    --exclude "*/*.pyc" \
    --exclude "*/slow_query_converter/logs/*.*" \
    --depends logcheck \
   --rpm-init          # /etc/init.d/XX 启动脚本。
    opt/slow_query_converter
    看起来比写RPM的spec文件要方便很多。当然spec可以指定uninstall等动作,这里似乎只有install。
阅读(1520) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~