docker部署owncloud私人网盘
1.部署mysql数据库
[root@tencent ~]# docker pull mysql:5.7
5.7: Pulling from library/mysql
a076a628af6f: Pull complete
f6c208f3f991: Pull complete
88a9455a9165: Pull complete
406c9b8427c6: Pull complete
7c88599c0b25: Pull complete
25b5c6debdaf: Pull complete
43a5816f1617: Pull complete
1831ac1245f4: Pull complete
37677b8c1f79: Pull complete
27e4ac3b0f6e: Pull complete
7227baa8c445: Pull complete
Digest: sha256:b3d1eff023f698cd433695c9506171f0d08a8f92a0c8063c1a4d9db9a55808df
Status: Downloaded newer image for mysql:5.7
[root@tencent ~]# docker run -it -d \
--restart=always \
--name mysql \
-p 3306:3306
-v /etc/my.cnf:/etc/my.cnf
-v /data/mysql/:/var/lib/mysql
-e MYSQL_ROOT_PASSWORD="123456" mysql:5.7 \
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
[root@tencent ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f1d1f273e3a9 mysql:5.7 "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
/etc/my.cnf的内容如下
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
#最大连接数
max_connections=1000
#时区
default-time_zone = '+8:00'
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
# By default we only accept connections from localhost
#bind-address = 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
2.部署owncloud
[root@tencent ~]# docker pull owncloud
Using default tag: latest
latest: Pulling from library/owncloud
177e7ef0df69: Pull complete
9bf89f2eda24: Pull complete
350207dcf1b7: Pull complete
a8a33d96b4e7: Pull complete
c0421d5b63d6: Pull complete
f76e300fbe72: Pull complete
af9ff1b9ce5b: Pull complete
d9f072d61771: Pull complete
a6c512d0c2db: Pull complete
5a99458af5f8: Pull complete
8f2842d661a0: Pull complete
3c71c5361f06: Pull complete
baeacbad0a0c: Pull complete
e60049bf081a: Pull complete
0619078e32d3: Pull complete
a8e482ee2313: Pull complete
174d1b06857d: Pull complete
4a86c437f077: Pull complete
5e9ed4c3df2d: Pull complete
8a1479477c8e: Pull complete
8ab262044e9e: Pull complete
Digest: sha256:173811cb4c40505401595a45c39a802b89fb476885b3f6e8fe327aae08d20fe8
Status: Downloaded newer image for owncloud:latest
[root@tencent ~]# docker run -it -d --restart=always --name owncloud -p 8080:80 --link mysql:db owncloud
3.访问web页面,ip+8080端口 ,自己设置用户名跟密码
4.点击安装完成,跳转到登录页面,输入账号密码登陆进去
结束!!!