上一篇文章进行了yum安装stress,这次对stress进行源码编译安装,并且生成新的镜像

  1. 创建Dockerfile目录

    [vagrant@localhost ~]$ mkdir -p /tmp/stress
    [vagrant@localhost stress]$ sudo vi Dockerfile
    FROM library/centos ADD Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
    ADD stress-1.0.4.tar.gz /usr/local/src
    RUN yum clean all && yum makecache && yum install -y make automake autoconf gcc gcc-c++
    WORKDIR /usr/local/src/stress-1.0.4
    RUN ./configure --prefix=/usr/local/stress
    RUN make && make install
    ENV PATH /usr/local/stress/bin:$PATH
    #CMD与ENTRYPOINT的区别在于执行docker run时参数传递的方式不同
    ENTRYPOINT ["stress", "--verbose"]
  2. 根据Dockerfile生成创建一个stress镜像
    docker build -t centos-stress-source:1.0.2 .
  3. 查看镜像 
    [vagrant@localhost stress]$ docker images
    REPOSITORY TAG IMAGE ID CREATED SIZE
    centos-stress-source 1.0.2 4f8b1ae5f7e8 7 minutes ago 546MB
  4. 测试是否可用
    [vagrant@localhost stress]$ docker run -ti --rm -m 200M --memory-swap=300M centos-stress-source:1.0.2 --vm 1 --vm-bytes 280M
    stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
    stress: dbug: [1] using backoff sleep of 3000us
    stress: dbug: [1] --> hogvm worker 1 [5] forked
    stress: dbug: [5] allocating 293601280 bytes ...
    stress: dbug: [5] touching bytes in strides of 4096 bytes ...
    stress: dbug: [5] freed 293601280 bytes
    stress: dbug: [5] allocating 293601280 bytes ...
    stress: dbug: [5] touching bytes in strides of 4096 bytes ...

基于centos 创建stress镜像——源码安装stress的更多相关文章

  1. CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境【转载】

    本文转载自 园友David_Tang的博客,如有侵权请联系本人及时删除,原文地址: http://www.cnblogs.com/mchina/archive/2012/11/28/2778779.h ...

  2. CentOS 6.5下源码安装MySQL 5.6

    变量lower_case_file_system说明是否数据目录所在的文件系统对文件名的大小写敏感.ON说明对文件名的大小写不敏感,OFF表示敏感. 在my.cnf中[mysqld]更改lower_c ...

  3. centos 6x系统下源码安装mysql操作记录

    在运维工作中经常部署各种运维环境,涉及mysql数据库的安装也是时常需要的.mysql数据库安装可以选择yum在线安装,但是这种安装的mysql一般是系统自带的,版本方面可能跟需求不太匹配.可以通过源 ...

  4. CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境

    一.简介 什么是LAMP    LAMP是一种Web网络应用和开发环境,是Linux, Apache, MySQL, Php/Perl的缩写,每一个字母代表了一个组件,每个组件就其本身而言都是在它所代 ...

  5. centos下mysql 5源码安装全过程记录

    参考:http://blog.csdn.net/mycwq/article/details/24488691 安装cmake,mysql 5.5以后的版本要通过cmake进行编译 在新装的CentOS ...

  6. centos 6.x x86 源码安装git-2.3.0

    (1) 添加rpmforge源 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686 ...

  7. CentOS 6.5 Git源码安装

    首先清除系统自带git,使用如下命令 yum -y remove git 一.下载Git源码包 wget https://www.kernel.org/pub/software/scm/git/git ...

  8. CentOS 6.5 Ruby源码安装

    清除旧版Ruby,若存在 yum remove ruby 若为源码,使用如下命令 cd <your-ruby-source-path> make uninstall 下面开始安装Ruby ...

  9. CentOS 5.8 x64 源码安装 samba-3.6.9

    环境 CentOS 5.8 X64      wget http://www.samba.org/samba/ftp/stable/samba-3.6.9.tar.gz   tar zxvf samb ...

随机推荐

  1. python中with用法及原理

    资源的管理在程序的设计上是一个很常见的问题,例如管理档案,开启的网络socket与各种锁定(locks)等.最主要的问题在于我们必须确保这些开启的资源在使用之后能够关闭(或释放),若忘记关闭这些资源, ...

  2. MySQL 查询优化之 Index Merge

    MySQL 查询优化之 Index Merge Index Merge Intersection 访问算法 Index Merge Union 访问算法 Index Merge Sort-Union ...

  3. Day17re模块和hashlib模块

    re模块 正则表达式 用一些特殊符号拼凑成的规则,去字符串中匹配到符合规则的东西 为什么有正则表达式 从字符串中取出想要的数据 怎么用正则表达式 re.findall()结果存成列表 \w 匹配一个字 ...

  4. if-else优化

    过多if-else分支的优化   超过3个就应该去优化,说if-else过多的分支可以使用switch或者责任链模式等等方式来优化.确实,这是一个小问题,不过我们还是可以整理一下这个小问题的重构方式. ...

  5. 7,数据类型转换,set 集合,和深浅copy

    str转换成list  用split list转换成str  用join tuple转换成list tu1 = (1,2,3) li = list(tu1)(强转) tu2 = tuple(li)(强 ...

  6. 【04】在 PR 中关闭 issue

    [04]在 PR 中关闭 issue   似乎要给别人PR.     比如你在创建一个 pull request 去修复 issue #234.那你可在 PR 输入「fixes #234」,就可以自动 ...

  7. 数据库质疑或只有MDF文件资料

    --允许进行系统表的操作 use master declare @databasename varchar(255) set @databasename='Blwy BarCode' --1.如果用户 ...

  8. OmniGraffler软件和激活码

    mac上用户画图的软件:OmniGraffler破解方法 1.激活码 Name: Appked SN: MFWG-GHEB-HYTW-CGHT-CSXU-QCNC-SXU 2.软件连接 链接: htt ...

  9. install composer on ubuntu14.04

    1.download composer $ sudo apt-get install curl $ curl -sS https://getcomposer.org/installer | php $ ...

  10. Codeforces Round #358 (Div. 2)——C. Alyona and the Tree(树的DFS+逆向思维)

    C. Alyona and the Tree time limit per test 1 second memory limit per test 256 megabytes input standa ...