Setup development environment on OSX

Posted by 4Aiur on 01/21/2015 in MacOSX |

Setup development environment on OSX

Install Homebrew on your laptop

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install some packages you like

cat > Caskfile 

Initialize virtual machine

boot2docker init
boot2docker start

A demonstration for build rpm in container

cat > Dockerfile 

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 install fpm --no-rdoc --no-ri

VOLUME /data
WORKDIR /data

CMD ["/bin/bash"]
EOF

$(boot2docker shellinit)
docker build -t mlf4aiur/fpm_rpm .

Put your package into data/ directory and run following command, then you’ll get the rpm file in you data directory.

docker run -it --rm -v pwd/data:/data mlf4aiur/fpm_rpm fpm \
    --verbose \
    -f \
    -s dir \
    -t rpm \
    --name hello_world \
    -v 0.9.0 \
    --config-files opt/hello_world/ \
    --exclude "*/*.pyc" \
    --depends python \
    opt/hello_world

Tags:

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.