V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cqxxxxxxx
V2EX  ›  程序员

[求助] docker 启动 Java 应用,设置的 JVM 参数失效

  •  1
     
  •   cqxxxxxxx · 2019-11-28 20:57:23 +08:00 · 2887 次点击
    这是一个创建于 1600 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Dockerfile image.png

    entrypoint.sh image.png

    进入容器中查看到的信息 image.png

    不论是 gc 日志还是设置的这些 JVM 参数都没有生效

    但是我进入容器手动执行启动命令就生效了

    图如果破了请访问 http://note.youdao.com/noteshare?id=a110ed7f71604c0d1576cc7a2448dcc2

    谢谢各位。

    自我感觉是很傻的错误导致的,但是一直没找到原因。

    第 1 条附言  ·  2019-11-28 21:34:46 +08:00
    Dockerfile




    entrypoint.sh




    进入容器查看

    9 条回复    2019-11-29 17:44:30 +08:00
    cqxxxxxxx
        1
    cqxxxxxxx  
    OP
       2019-11-28 21:12:42 +08:00 via Android
    有人能帮帮我🐴 随便给点提示之类的
    cqxxxxxxx
        2
    cqxxxxxxx  
    OP
       2019-11-28 21:35:22 +08:00
    还是有图片显示不了。尴尬
    mondeo
        3
    mondeo  
       2019-11-28 21:36:08 +08:00 via Android   ❤️ 1
    看看 gnu 基金会,linux 基金会,都是在美国注册的实体组织
    expy
        4
    expy  
       2019-11-28 21:42:17 +08:00   ❤️ 1
    看你图上 ps 显示的进程,有前面设置的参数吧?不生效是指?
    cqxxxxxxx
        5
    cqxxxxxxx  
    OP
       2019-11-28 21:45:24 +08:00 via Android
    @expy 你看 ps 后面那几行 jinfo 打印出来的都是带个 负号
    显示没有生效
    cqxxxxxxx
        6
    cqxxxxxxx  
    OP
       2019-11-28 21:46:57 +08:00 via Android
    @expy 你看我 entrypoint.sh 的脚本写的有问题吗? 我 shell 脚本不太熟练 不清楚是不是这里的问题
    expy
        7
    expy  
       2019-11-28 22:31:27 +08:00   ❤️ 1
    @cqxxxxxxx 启动脚本最后一行去掉 JAVA_OPTS 的引号试试?
    cqxxxxxxx
        8
    cqxxxxxxx  
    OP
       2019-11-29 09:15:19 +08:00
    @expy 非常感谢!!。我去掉了确实生效了。。。这个是为什么啊。昨天搞了我好两个小时
    expy
        9
    expy  
       2019-11-29 17:44:30 +08:00   ❤️ 1
    @cqxxxxxxx 引号把全部参数变成一个了吧,就是不知道怎么没报错。

    比如:
    $ ls a b c;ls "a b c"
    ls: cannot access 'a': No such file or directory
    ls: cannot access 'b': No such file or directory
    ls: cannot access 'c': No such file or directory
    ls: cannot access 'a b c': No such file or directory
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   6057 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 06:18 · PVG 14:18 · LAX 23:18 · JFK 02:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.