{"id":1414,"date":"2021-04-14T19:21:18","date_gmt":"2021-04-14T10:21:18","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/?p=1414"},"modified":"2021-04-14T19:22:05","modified_gmt":"2021-04-14T10:22:05","slug":"remote-java-container-debug","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2021\/04\/14\/remote-java-container-debug\/","title":{"rendered":"\u30ea\u30e2\u30fc\u30c8\u306eDocker\u3067\u52d5\u4f5c\u3059\u308bJava\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"
Docker for Mac\u306e\u52d5\u4f5c\u304c\u91cd\u304f\u3001\u5909\u66f4\u306e\u53cd\u6620\u3084\u518d\u8d77\u52d5\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u72b6\u614b\u3067\u3042\u3063\u305f\u305f\u3081\u3001EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u7acb\u3066\u305fDocker\u3067\u30c7\u30d0\u30c3\u30b0\u5b9f\u884c\u3092\u3057\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u3002IntelliJ IDEA\u306e\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30c3\u30b0\u3068\u3044\u3046\u6a5f\u80fd\u3092\u4f7f\u3046\u3068\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u5177\u4f53\u7684\u306a\u8a2d\u5b9a\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n
IntelliJ IDEA\u306eRun\/Debug Configuration\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u30c7\u30d0\u30c3\u30b0\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n
Run\u30bf\u30d6\u304b\u3089\u300cEdit Configurations...\u300d \u3092\u9078\u629e\u3057\u307e\u3059\u3002 \u300cConfiguration\u300d\u306e\u300cHost\u300d\u306b\u30ea\u30e2\u30fc\u30c8\u306e\u30db\u30b9\u30c8\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u307e\u3059\u3002 \u300cCommand line arguments for remote JVM\u300d\u306e\u5185\u5bb9\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002\uff08\u5f8c\u307b\u3069\u30b3\u30f3\u30c6\u30ca\u5074\u306e\u8a2d\u5b9a\u3067\u5fc5\u8981\uff09<\/p>\n \u4ee5\u4e0a\u3067\u3001IDE\u5074\u306e\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n \u5148\u7a0b\u30b3\u30d4\u30fc\u3057\u305f\u5024\u3092\u3001\u5b9f\u884c\u5bfe\u8c61\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e build.gradle \u306ebootRun\u30b3\u30de\u30f3\u30c9\u306b\u5bfe\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n \u6b21\u306b\u30015005\u756a\u30dd\u30fc\u30c8\u3092\u958b\u653e\u3057\u307e\u3059\u3002 \u6700\u5f8c\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u3067\u3001 \u4ee5\u4e0a\u306e\u8a2d\u5b9a\u3067\u5168\u3066\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n \u4ee5\u964d\u306f\u30ed\u30fc\u30ab\u30eb\u3067\u306e\u5b9f\u884c\u540c\u69d8\u3001\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u30bb\u30c3\u30c8\u3057\u3001\u30c7\u30d0\u30c3\u30b0\u5b9f\u884c\u3092\u884c\u3046\u3068\u305d\u3053\u3067\u505c\u6b62\u3057\u3066\u304f\u308c\u307e\u3059\uff01<\/p>\n \u610f\u5916\u3068\u7c21\u5358\u306a\u8a2d\u5b9a\u3067\u30c7\u30d0\u30c3\u30b0\u5b9f\u884c\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u3068\u3066\u3082\u4fbf\u5229\u3067\u3057\u305f\u3002
\n<\/a><\/p>\n
\n<\/a><\/p>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a<\/h3>\n
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005<\/code><\/pre>\n
\u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a<\/h3>\n
\n
bootRun {\njvmArgs "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n
\n\u4ee5\u4e0b\u306fdocker-compose\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306e\u8a2d\u5b9a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n
ports:\n - 8080:8080\n - 5005:5005<\/code><\/pre>\n<\/li>\n<\/ul>\n
\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306e\u8a2d\u5b9a<\/h3>\n
\n8080\u30015005\u756a\u30dd\u30fc\u30c8 \u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3057\u3066\u304f\u3060\u3055\u3044\u3002
\n<\/a>
\n<\/a><\/p>\n\u307e\u3068\u3081<\/h2>\n
\n\u3082\u3061\u308d\u3093\u3001localhost\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u30ed\u30fc\u30ab\u30eb\u3067\u8d77\u52d5\u3057\u3066\u3044\u308bDocker\u306b\u5bfe\u3057\u3066\u3082\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305c\u3072\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/h2>\n