首页 文章 精选 留言 我的

精选列表

搜索[自动发现],共10000篇文章
优秀的个人博客,低调大师

docker 自动构建,基于Dockerfile文件

原文地址:http://kekefund.com/2017/03/06/docker-dockerfile-generated/ 1,Dockerfile的编写 在centos中创建一个目录:/mydata/data/dockertest/,新建Dockerfile文件 vim Dockerfile # Verison 0.6: # 基础镜像 FROM chenbb/fofeasy:0.6 # 维护者信息 MAINTAINER cbbing@163.com # 镜像操作命令 RUN rm -rf /opt/tomcat/webapps/fofeasy RUN rm -rf /opt/tomcat/webapps/fofeasy.war ADD fofeasy.war /opt/tomcat/webapps/fofeasy.war # 容器启动命令 #CMD ["/opt/tomcat/bin/catalina.sh", "run"] 编写完成后:wq保存。 2,构建 基于Dockerfile构建镜像,在Dockerfile文件所在目录下执行 [root@VM_200_249_centos dockertest]# docker build -t chenbb/fofeasy:0.7 . Sending build context to Docker daemon 65.78 MB Step 1 : FROM chenbb/fofeasy:0.6 ---> c441af7f5405 Step 2 : MAINTAINER cbbing@163.com ---> Running in f7cbd5cd3199 ---> cef4cee90997 Removing intermediate container f7cbd5cd3199 Step 3 : RUN rm -rf /opt/tomcat/webapps/fofeasy ---> Running in 79505ed64d7f ---> 4f85be099a20 Removing intermediate container 79505ed64d7f Step 4 : RUN rm -rf /opt/tomcat/webapps/fofeasy.war ---> Running in be162f93530b ---> c5cc2ba60023 Removing intermediate container be162f93530b Step 5 : ADD fofeasy.war /opt/tomcat/webapps/fofeasy.war ---> 8ede3a4f83e5 Removing intermediate container b9b557e26828 Successfully built 8ede3a4f83e5 [root@VM_200_249_centos dockertest]# 注: chenbb/fofeasy:0.7为新镜像的名字 fofeasy.war文件放到同一目录 [root@VM_200_249_centos dockertest]# ll -lh 总用量 63M -rw-r--r-- 1 root root 322 3月 3 17:00 Dockerfile -rw-r--r-- 1 root root 63M 3月 3 16:46 fofeasy.war 3,启动 docker run -d -p 58080:8080 --name javaweb chenbb/javaweb:0.7 /root/run.sh 3,一些问题 容器启动不起来 考虑是容器里的命令执行报错引起的,重新从镜像创建容器,排除问题,或者通过 "docker logs <容器ID>" 查看错误日志 参考 http://www.jianshu.com/p/690844302df5

优秀的个人博客,低调大师

openstack 镜像自动扩容 resize拉伸

The simplest way to support this in your image is to install the cloud-utils package (contains the growpart tool for extending partitions), the cloud-initramfs-growroot package (which supports resizing root partition on the first boot), and the cloud-init package into your image. With these installed, the image performs the root partition resize on boot. For example, in the /etc/rc.local file. These packages are in the Ubuntu and Debian package repository, as well as the EPEL repository (for Fedora/RHEL/CentOS/Scientific Linux guests). If you cannot install cloud-initramfs-tools, Robert Plestenjak has a github project called linux-rootfs-resize that contains scripts that update a ramdisk by using growpart so that the image resizes properly on boot. If you can install the cloud-utils and cloud-init packages, we recommend that when you create your images, you create a single ext3 or ext4 partition (not managed by LVM).

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册