GVKun编程网logo

基于 centos 创建 stress 镜像 —— 源码安装 stress(centos制作镜像)

26

在本文中,我们将为您详细介绍基于centos创建stress镜像——源码安装stress的相关知识,并且为您解答关于centos制作镜像的疑问,此外,我们还会提供一些关于Accessrestricti

在本文中,我们将为您详细介绍基于 centos 创建 stress 镜像 —— 源码安装 stress的相关知识,并且为您解答关于centos制作镜像的疑问,此外,我们还会提供一些关于Access restriction: The constructor SunJCE() is not accessib、Access restriction: The constructor SunJCE() is not accessible、Access restriction: The type ''AudioStream'' is not、Access restriction: The type BASE64Encoder is not accessible due to restrict on required library的有用信息。

本文目录一览:

基于 centos 创建 stress 镜像 —— 源码安装 stress(centos制作镜像)

基于 centos 创建 stress 镜像 —— 源码安装 stress(centos制作镜像)

上一篇文章进行了 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 ...

Access restriction: The constructor SunJCE() is not accessib

Access restriction: The constructor SunJCE() is not accessib

问题现象: Access restriction: The constructor SunJCE() is not accessible due to restriction on required library 原因分析: 大致意识是依赖库SunJCE() 构造函数被限制访问; 解决思路: 方案一: Window - Preferences - Java - Compiler - Errors/War

问题现象:

        Access restriction: The constructor SunJCE() is not accessible due to restriction on required library 

原因分析:

        大致意识是依赖库 SunJCE() 构造函数被限制访问;

解决思路:

方案一:Window -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rules) -> Warnings


Access restriction: The constructor SunJCE() is not accessib未完待续....

Access restriction: The constructor SunJCE() is not accessible

Access restriction: The constructor SunJCE() is not accessible

Description Resource Path Location Type
Access restriction: The constructor SunJCE() is not accessible due to restriction on required library D:\Program Files (x86)\Java\jdk1.6.0_29\jre\lib\ext\sunjce_provider.jar CCi.java line 22 Java Problem

解决办法:将 Errors/Warnings 中的 Forbidden reference (access rules): 由 Error 修改为 Warning 即可

Access restriction: The type ''AudioStream'' is not

Access restriction: The type ''AudioStream'' is not

eclipse 项目找不到rt.jar中的类

解决方法: 
        选中项目右击 -> build Path-> configure build path ->libraries, 
        先 remove 掉 JRE System Library,然后再 Add Library 重新加入
。 

Access restriction: The type BASE64Encoder is not accessible due to restrict on required library

Access restriction: The type BASE64Encoder is not accessible due to restrict on required library

    今天在写一个WebService程序时,用到了sun.misc.BASE64Encoder().encode(baos.toByteArray()); 但遇到了一个错误:

Access restriction: The type BASE64Encoder is not accessible due to restrict on required library  java/lib/rt.jar。

导入了这个jar可是还是不行,于是查了一下,解决方法是在project的build path里先删除JRE System Library,然后再添加一遍,就好了。

我也不知道为什么这么做,求大神解释~~

关于基于 centos 创建 stress 镜像 —— 源码安装 stresscentos制作镜像的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Access restriction: The constructor SunJCE() is not accessib、Access restriction: The constructor SunJCE() is not accessible、Access restriction: The type ''AudioStream'' is not、Access restriction: The type BASE64Encoder is not accessible due to restrict on required library等相关内容,可以在本站寻找。

本文标签: