V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
cqxxxxxxx
V2EX  ›  程序员

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

  •  1
     
  •   cqxxxxxxx · Nov 28, 2019 · 3544 views
    This topic created in 2342 days ago, the information mentioned may be changed or developed.

    Dockerfile image.png

    entrypoint.sh image.png

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

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

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

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

    谢谢各位。

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

    Supplement 1  ·  Nov 28, 2019
    Dockerfile




    entrypoint.sh




    进入容器查看

    9 replies    2019-11-29 17:44:30 +08:00
    cqxxxxxxx
        1
    cqxxxxxxx  
    OP
       Nov 28, 2019 via Android
    有人能帮帮我🐴 随便给点提示之类的
    cqxxxxxxx
        2
    cqxxxxxxx  
    OP
       Nov 28, 2019
    还是有图片显示不了。尴尬
    mondeo
        3
    mondeo  
       Nov 28, 2019 via Android   ❤️ 1
    看看 gnu 基金会,linux 基金会,都是在美国注册的实体组织
    expy
        4
    expy  
       Nov 28, 2019   ❤️ 1
    看你图上 ps 显示的进程,有前面设置的参数吧?不生效是指?
    cqxxxxxxx
        5
    cqxxxxxxx  
    OP
       Nov 28, 2019 via Android
    @expy 你看 ps 后面那几行 jinfo 打印出来的都是带个 负号
    显示没有生效
    cqxxxxxxx
        6
    cqxxxxxxx  
    OP
       Nov 28, 2019 via Android
    @expy 你看我 entrypoint.sh 的脚本写的有问题吗? 我 shell 脚本不太熟练 不清楚是不是这里的问题
    expy
        7
    expy  
       Nov 28, 2019   ❤️ 1
    @cqxxxxxxx 启动脚本最后一行去掉 JAVA_OPTS 的引号试试?
    cqxxxxxxx
        8
    cqxxxxxxx  
    OP
       Nov 29, 2019
    @expy 非常感谢!!。我去掉了确实生效了。。。这个是为什么啊。昨天搞了我好两个小时
    expy
        9
    expy  
       Nov 29, 2019   ❤️ 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1064 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 18:40 · PVG 02:40 · LAX 11:40 · JFK 14:40
    ♥ Do have faith in what you're doing.