ホスト側でやること†
yum -y install docker-io
systemctl enable docker.service
systemctl start docker.service
docker pull centos:latest
docker run --privileged -d centos --name "init" /sbin/init
docker exec -it init bash
コンテナ側でやること†
yum -y install httpd
cd /etc/httpd/
rm -rf logs
mkdir logs
chown apache.apache logs
echo hogehoge > /var/www/html/index.html
systemctl enable httpd.service
systemctl start httpd.service
exit
ホスト側でやること†
docker commit init apache
docker run --privileged -p 180:80 -d apache /sbin/init
wget localhost:180
export†
docker ps
でPSID をチェック
docker export [PSID] > apache.tar
ホスト2側†
cat apache.tar | docker import - apache
docker run --privileged -p 180:80 -d apache /sbin/init
wget localhost:180