docker-machine ssh default  docker logs test sudo systemctl start docker       docker tag IMAGEID new_repository newTAG docker commit -a 'message aaaa' CONTAINER_ID NEW_IMAGE_NAME
VBoxManage modifyvm "default" --natpf1 "tcp-port90,tcp,,90,,90"
VBoxManage modifyvm "default" --natpf1 "tcp-port91,tcp,,91,,91"
VBoxManage modifyvm "default" --natpf1 "tcp-port80,tcp,,80,,80"
VBoxManage modifyvm "default" --natpf1 "tcp-port3000,tcp,,3000,,3000"
VBoxManage modifyvm "default" --natpf1 "tcp-port3001,tcp,,3001,,3001"
VBoxManage modifyvm "default" --natpf1 "tcp-port3002,tcp,,3002,,3002"

VBoxManage modifyvm "default" --natpf1 "tcp-port9000,tcp,,9000,,9000"

VBoxManage modifyvm "default" --natpf1 "tcp-port27017,tcp,,27017,,27017"

VBoxManage modifyvm "default" --natpf1 "tcp-port3306,tcp,,3306,,3306"

VBoxManage modifyvm "default" --natpf1 "tcp-port6379,tcp,,6379,,6379"

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)

sudo mount -t cifs -o username=jianyeruan,password="123" //192.168.1.5/jayruanwork /home/docker //他们有app,config cd / sudo -umount /home/docker
sudo mount -t cifs -o username=menusifu2015,password="123456" //192.168.1.125/jayruanwork /home/docker

docker run  --name redis -it -p 6379:6379  redis redis-server  --appendonly yes
1,开发测试时 不用link
docker run -d --name data -v /home/docker/app:/usr/share/jayruanwork centos
2,
docker run -d --volumes-from=data --name mongo -p 27017:27017 mongo
docker run -d --volumes-from=data --name mongo -p 27017:27017 -e MONGODB_PASS="123456" jianyeruan/mongo

docker run -d --volumes-from=data --name mariadb -e -p 3306:3306 MYSQL_ROOT_PASSWORD=123456 jianyeruan/mariadb
3,
docker run -d --volumes-from=data --name php7-fpm -p 9000:9000 php:7-fpm
docker run -d --volumes-from=data --name=nodejs -p 3001:3001 jianyeruan/node supervisor vip/app.js

docker run -it --volumes-from=data --name=nodejs3 -p 3001:3001 jianyeruan/node  supervisor ./node2016/bin/www
4,nginx
docker run -d --name=nginx -p 80:80 -p 90:90 --volumes-from=data -v /home/docker/config/nginx:/etc/nginx/conf.d nginx

备份
docker exec mongo mongodump -d testdb -o /usr/share/jayruanwork/mongo -u admin -p=123456 --authenticationDatabase admin 
mongoexport -d testdb -c test -o students.dat -u admin -p=mypass --authenticationDatabase admin

mongoexport -d dba22 -c foo -f x,y,a,b,c --csv -o ./result.csv

 mongoexport -d restaurant -c restaurants --csv -f state,name,phone -o students_csv.csv
还原

docker exec mongo mongorestore -d testdb /usr/share/jayruanwork/mongo/testdb -u admin -p=mypass --authenticationDatabase admin
mongoimport -d testdb -c students students.dat -u admin -p=mypass --authenticationDatabase admin 

备份
mysqldump --user=root --password=123456 mysql mysql1 > dbbackupscript.sql
gzip /backup/*.sql
mysqldump --user=root --password=123456 –all-databases> dbbackupscript.sql

还原create database mydb;
mysql --user=root --password=123456 mysql1 < dbbackupscript.sql

mysql --user=root --password=123456 --one-database database_name < all_databases.sql

upload .

docker run --rm jianyeruan/centos gsutil cp /a.txt gs://jayruanbackup
gsutil cp a.txt gs://jayruanbackup
gsutil -m cp -r folder gs://jayruanbackup
gsutil ls gs://uspto-pair/applications/0800401*
gsutil cp gs://jayruanbackup/* .

正式上线时:link 然后不用映射端口

--link mongo:mongo --link php7-fpm:fpm --link mariadb:mariadb
程序里的location或127.0.0.1 用:后面代替.
nginx link php ;php link 数据库
nginx link node[失败还没有找到原因]; node link 数据库

node=>add supervisor and GraphicsMagick,php-7fpm,nginx=>加了gzip,mongo=>auth,mariadb

 

http://zeptojs.com/zepto.min.js
https://github.com/jieyou/lazyload

docker run -d --volumes-from=data --name css yajo/sass sass --watch /usr/share/jayruanwork/nginx/scss:/usr/share/jayruanwork/nginx/css
docker run -d --volumes-from=data --name css2 yajo/sass sass --style compressed /usr/share/jayruanwork/nginx/scss/test.scss:/usr/share/jayruanwork/nginx/css/test.css

 

 sudo service docker start

docker run -d -p 27017:27017 -p 28017:28017 tutum/mongodb
docker run -d -p 27017:27017 -p 28017:28017 -e MONGODB_USER="user" -e MONGODB_PASS="mypass" tutum/mongodb:3.2

mongo admin -u admin -p mypass

 

 

  1. mongoexport -d dba22 -c foo -f x,y,a,b,c --csv -o ./result.csv  
 posted on 2016-01-03 11:28  jayruan  阅读(3183)  评论(0编辑  收藏  举报