Author Archives: Pavlo Khmel

Docker – CentOS 7 container on Ubuntu

Create base image from current CentOS 7 system with one command:

tar --numeric-owner --exclude=/proc --exclude=/sys --exclude=/boot --exclude=/usr/lib/firmware --exclude=/usr/lib/modules --exclude=/usr/lib/udev -cvf centos7.tar /

You will have file size 565M from CentOS 7 minimal install.

More optimal way: https://github.com/docker/docker/blob/master/contrib/mkimage-yum.sh
As result you'll have 247M file.

Continue reading

Vagrant – backup and restore environment

This post is related to previous post "Vagrant with multiple machines and ports".

1. Backup boxes

Remove file 70-persistent-net.rules on appsrv and monsrv before backup:

ssh -i ~/.vagrant.d/id_rsa vagrant@127.0.0.1 -p 3333 'sudo rm -f /etc/udev/rules.d/70-persistent-net.rules'
ssh -i ~/.vagrant.d/id_rsa vagrant@127.0.0.1 -p 4444 'sudo rm -f /etc/udev/rules.d/70-persistent-net.rules'

Continue reading