-
Notifications
You must be signed in to change notification settings - Fork 18
서버 이전
ChangHoon, Jeong edited this page Jul 7, 2014
·
4 revisions
$ docker run --volumes-from rorla_uploads -v /root/backup:/backup busybox tar cvf /backup/rorla_uploads.tar /app/public/uploads
tutum/mysql 데이터 저장소 /var/lib/mysql
, 컨테이너 이름 mysql
만약에 신규서버 복원할때 처럼 DB폴더를 별도의 볼륨 컨테이너 사용하면 해당 --volumes-from mysql
을 --volumes-from rorla_mysql_data
로 변경
$ docker run --volumes-from mysql -v /root/backup:/backup busybox tar cvf /backup/rorla_mysql.tar /var/lib/mysql
$ docker run --name some-nginx -v /root/backup:/usr/local/nginx/html:ro -p 80:80 -d nginx
$ cd /root
$ wget http://기존서버/rorla_mysql.tar
$ wget http://기존서버/rorla_uploads.tar
$ docker run -v /app/public/uploads --name rorla_uploads busybox
$ docker run --rm --volumes-from rorla_uploads -v /root/backup:/backup busybox tar xvf /backup/rorla_uploads.tar
MySQL용 별도 볼륨 컨테이너 사용
$ docker run -v /var/lib/mysql --name rorla_mysql_data busybox
$ docker run --rm --volumes-from rorla_mysql_data -v /root/backup:/backup busybox tar xvf /backup/rorla_mysql.tar
$ docker run --name mysql --volumes-from rorla_mysql_data -e MYSQL_USERNAME="admin" -e MYSQL_PASS="yourpasswd" -d tutum/mysql