docker快速构建disconf镜像

时间:2021-04-17 04:28:34
【文件属性】:

文件名称:docker快速构建disconf镜像

文件大小:35.97MB

文件格式:RAR

更新时间:2021-04-17 04:28:34

docker disconf

准备mysql, tomcat, nginx的Dockerfile文件,用于生成定制的镜像 redis,zookeeper 镜像直接从云端获取。 打开终端进入tomcat目录,执行: docker build -t conf_tomcat:0.0.1 . 再进入nginx目录,执行: docker build -t conf_nginx:0.0.1 . 再进入mysql目录,执行: docker build -t conf_mysql:0.0.1 . docker images 就能看到这三个新的镜像 root@ubuntu:/home/anan/docker/docker_disconf-master# docker images REPOSITORY TAG IMAGE ID CREATED SIZE conf_mysql 0.0.1 deed528eba7f 13 hours ago 256 MB conf_nginx 0.0.1 655a8ea20190 16 hours ago 111 MB conf_tomcat 0.0.1 8dbaa04dfd30 16 hours ago 393 MB 到docker-composer.yml的目录下,执行: docker-compose up -d 执行完成之后,就可以通过docker ps 看到启动的容器 root@ubuntu:/home/anan/docker/docker_disconf-master# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES de596887acac conf_nginx:0.0.1 "nginx -g 'daemon ..." About an hour ago Up About an hour 0.0.0.0:80->80/tcp dockerdisconfmaster_disconf_nginx_1 5bbdb21bf496 conf_tomcat:0.0.1 "catalina.sh run" About an hour ago Up About an hour 8080/tcp dockerdisconfmaster_disconf_tomcat_1 e050bb3c4d05 daocloud.io/library/redis "docker-entrypoint..." About an hour ago Up About an hour 6379/tcp dockerdisconfmaster_disconf_redis_1_1 dd676e1ecbee zookeeper:3.3.6 "/docker-entrypoin..." About an hour ago Up About an hour 0.0.0.0:2181->2181/tcp, 0.0.0.0:2888->2888/tcp, 0.0.0.0:3888->3888/tcp dockerdisconfmaster_disconf_zookeeper_1 8efcbedb9a44 daocloud.io/library/redis "docker-entrypoint..." About an hour ago Up About an hour 6379/tcp dockerdisconfmaster_disconf_redis_2_1 eb0d9c248401 conf_mysql:0.0.1 "docker-entrypoint..." About an hour ago Up About an hour 0.0.0.0:3306->3306/tcp dockerdisconfmaster_disconf_mysql_1 现在打开浏览器即可访问disconf 的web端, 用户名和密码都是admin. 停止整个环境的命令: docker-compose stop 删除整个环境的命令: docker-compose rm


网友评论