-
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。
阅读(1586) | 评论(0) | 转发(0) |