linux docker扩展 安装mariadb、fastdfs

– 执行命令

docker run -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --name mariadb -d 
-v /usr/local/src/mariadb/data:/var/lib/mysql 
-v /usr/local/src/mariadb/conf/my.cnf:/etc/mysql/my.cnf 
--restart unless-stopped docker.io/mariadb:latest
-- 复制配置文件
docker cp mariadb:/var/lib/mysql /usr/local/src/mariadb/data
docker cp mariadb:/etc/mysql/my.cnf /usr/local/src/mariadb/conf
docker exec -it mariadb /bin/bash
--不持久化配置文件
docker run -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --name mariadb -d --restart unless-stopped docker.io/mariadb:latest

chcon -Rt svirt_sandbox_file_t /mariadb

-- mysql
docker run -d -p 3306:3306 -v /usr/local/mysql/data:/var/lib/mysql -v /usr/local/mysql/conf/mysql.cnf:/etc/mysql/mysql.cnf -e MYSQL_ROOT_PASSWORD=root --name mysql57 --restart=always docker.io/mysql:5.7

docker run -d -p 3306:3306 -v /usr/local/mysql/data:/var/lib/mysql -v /usr/local/mysql/conf/:/etc/mysql/ -e MYSQL_ROOT_PASSWORD=root --name mysql57 --restart=always docker.io/mysql:5.7

docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --name mysql57 docker.io/mysql:5.7
 
-- fastdfs
// 创建tracker容器
docker run -ti -d --name trakcer -v ~/tracker_data:/fastdfs/tracker/data --net=host season/fastdfs tracker

//使用docker镜像构建storage容器(存储服务器,提供容量和备份服务)
docker run -tid --name storage -v ~/storage_data:/fastdfs/storage/data -v ~/store_path:/fastdfs/store_path --net=host -e TRACKER_SERVER:192.168.115.130:22122 -e GROUP_NAME=group1 season/fastdfs storage

docker run --add-host fastdfs.net:192.168.1.40 --name fastdfs --net=host -e TRACKER_ENABLE=1 -e NGINX_PORT=81 -v /home/fastdfs:/storage/fastdfs -it mypjb/fastdfs
 
// fastdfs 
docker run -d --restart=always --privileged=true --net=host --name=fastdfs -e IP=47.93.57.130 -e WEB_PORT=8111 -v ${HOME}/fastdfs:/var/local/fdfs --name fastdfs registry.cn-beijing.aliyuncs.com/tianzuo/fastdfs

docker run -d -p 8080:8080 --name tomcat -v /usr/local/tomcat/webapps:/usr/local/tomcat/webapps -v /usr/local/tomcat/conf:/usr/local/tomcat/conf -v /usr/local/tomcat/logs:/usr/local/tomcat/logs --restart=always tomcat

docker run -d -p 8080:8080 --name tomcat -v /usr/local/tomcat/webapps:/usr/local/tomcat/webapps -v /usr/local/tomcat/conf:/usr/local/tomcat/conf -v /usr/local/tomcat/logs:/usr/local/tomcat/logs --restart=always tomcat

你可能感兴趣的:(linux下环境配置)