使用MySQL:5.6和owncloud镜像搭建个人网盘

拉取镜像

[root@kvm ~]# docker pull mysql:5.6

[root@kvm ~]# docker pull owncloud

启动mysql容器

[root@kvm ~]# docker run -d --name db1 -e MYSQL_ROOT_PASSWORD=root mysql:5.6 
db832e4e4333a0e9a7c152a67272721fdbe5381054090c5eb24f90455390a852
[root@kvm ~]# docker ps
CONTAINER ID   IMAGE       COMMAND                  CREATED         STATUS         PORTS      NAMES
db832e4e4333   mysql:5.6   "docker-entrypoint.s…"   3 seconds ago   Up 2 seconds   3306/tcp   db1

owncloud容器链接mysql

[root@kvm ~]# docker run --link db1 -d owncloud:latest 
2e77278c1070abb5591eb90b54d2dcb892063936f6deacbb1fe057eb712807b9
[root@kvm ~]# docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED         STATUS         PORTS      NAMES
eaa847239886   owncloud:latest   "docker-entrypoint.s…"   4 seconds ago   Up 3 seconds   80/tcp     mycloud
db832e4e4333   mysql:5.6         "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes   3306/tcp   db1

安装个人网盘

过滤owncloud容器IP

[root@kvm ~]# docker inspect mycloud | grep -i ipaddress
            "SecondaryIPAddresses": null,
            "IPAddress": "172.17.0.3",
                    "IPAddress": "172.17.0.3",

浏览器访问

使用MySQL:5.6和owncloud镜像搭建个人网盘_第1张图片

过滤mysql容器IP

[root@kvm ~]# docker inspect db1 | grep -i ipaddress
            "SecondaryIPAddresses": null,
            "IPAddress": "172.17.0.2",
                    "IPAddress": "172.17.0.2",

配置安装环境

使用MySQL:5.6和owncloud镜像搭建个人网盘_第2张图片

登录

使用MySQL:5.6和owncloud镜像搭建个人网盘_第3张图片

你可能感兴趣的:(Docker,mysql,数据库,docker)