mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-25 03:58:54 +00:00
Add JAVA_AGENTS and JVM_AGENTS to load agents from URLs and paths (#4356)
This commit is contained in:
1 parent
b64207b3c9
commit
7c486b27b7
6 files changed
+90
No files matched your search
@@ -89,6 +89,33 @@ you can use
|
||||
JVM_DD_OPTS: fml.queryResult=confirm,name=value
|
||||
```
|
||||
|
||||
## Java and JVM Agents
|
||||
|
||||
Java agents, such as [authlib-injector](https://github.com/yushijinhun/authlib-injector), can be loaded into the server by setting `JAVA_AGENTS`, and native JVM agents by setting `JVM_AGENTS`. Like [the `MODS` / `PLUGINS` variables](../mods-and-plugins/index.md#modsplugins-list), both are a comma or newline delimited list of
|
||||
|
||||
- URL of an agent file
|
||||
- container path to an agent file
|
||||
- container path to a directory containing agent jar files for `JAVA_AGENTS`, or `.so` files for `JVM_AGENTS`
|
||||
|
||||
The agents are copied into `/data/agents/java` and `/data/agents/jvm`, and each one is passed to the JVM as `-javaagent:<file>` or `-agentpath:<file>`, in file name order.
|
||||
|
||||
!!! example
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
JAVA_AGENTS: |
|
||||
https://www.example.com/agents/agent.jar
|
||||
/agents
|
||||
```
|
||||
|
||||
!!! note "Auto-removal"
|
||||
|
||||
Entries that are removed from the `JAVA_AGENTS` or `JVM_AGENTS` list will be automatically removed from the agents directory, so they are no longer loaded.
|
||||
|
||||
!!! note "Agent options"
|
||||
|
||||
An agent that needs options, such as `-javaagent:agent.jar=options`, can still be passed with `JVM_OPTS` instead.
|
||||
|
||||
## Enable Remote JMX for Profiling
|
||||
|
||||
To enable remote JMX, such as for profiling with VisualVM or JMC, set the environment variable `ENABLE_JMX` to "true", set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as:
|
||||
|
||||
@@ -147,6 +147,18 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>JAVA_AGENTS</code></td>
|
||||
<td>Comma or newline delimited list of Java agent jar URLs, container paths to jars, or container paths to directories of jars, which are loaded with <code>-javaagent</code></td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>JVM_AGENTS</code></td>
|
||||
<td>Comma or newline delimited list of native JVM agent URLs, container paths to agents, or container paths to directories of <code>.so</code> agents, which are loaded with <code>-agentpath</code></td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>EXTRA_ARGS</code></td>
|
||||
<td>Arguments that would usually be passed to the jar file (those which are written after the filename)</td>
|
||||
|
||||
Reference in new issue
Block a user