Skip to content

Commit d20cd2d

Browse files
authored
Add jattach utility (#4114)
1 parent b67d88f commit d20cd2d

6 files changed

Lines changed: 58 additions & 5 deletions

File tree

.github/workflows/verify-docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Verify Docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'docs/**'
7+
- 'zensical.toml'
8+
- '.github/workflows/verify-docs.yml'
9+
workflow_dispatch:
10+
11+
jobs:
12+
verify:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
21+
- name: Build docs image
22+
uses: docker/build-push-action@v6
23+
with:
24+
context: .
25+
file: docs/Dockerfile
26+
load: true
27+
tags: docs-verifier:latest
28+
cache-from: type=gha
29+
cache-to: type=gha,mode=max
30+
31+
- name: Verify rendering
32+
run: |
33+
docker run --rm \
34+
-v ${{ github.workspace }}:/docs \
35+
docs-verifier:latest build --strict

build/alpine/install-packages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ apk add --no-cache -U \
3333
libwebp \
3434
libcap \
3535
numactl \
36+
jattach \
3637
${EXTRA_ALPINE_PACKAGES}
3738

3839
# Download and install patched knockd

build/ubuntu/install-packages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ apt-get install -y \
3030
libpcap0.8 \
3131
libnuma1 \
3232
libcap2-bin \
33+
jattach \
3334
${EXTRA_DEB_PACKAGES}
3435

3536
# Clean up APT when done

docs/misc/troubleshooting.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,20 @@ The labels that are most interesting are:
3535

3636
- `org.opencontainers.image.created` : the date/time the image was built
3737
- `org.opencontainers.image.revision` : which maps to <https://github.com/itzg/docker-minecraft-server/commit/REVISION>
38-
- `org.opencontainers.image.version` : image tag and variant [as described in this page](../versions/java.md)
38+
- `org.opencontainers.image.version` : image tag and variant [as described in this page](../versions/java.md)
39+
40+
## jattach
41+
42+
This image bundles the [jattach](https://github.com/jattach/jattach) utility for attaching to running Java processes. It is described as
43+
44+
> The utility to send commands to a JVM process via Dynamic Attach mechanism.
45+
>
46+
> All-in-one jmap + jstack + jcmd + jinfo functionality in a single tiny program.
47+
48+
When exec'ed interactively into the container, jattach can be invoked against the Minecraft server's java process by using commands similar to the following
49+
50+
!!! example
51+
52+
```shell
53+
jattach $(pgrep java) threaddump
54+
```

docs/sending-commands/ssh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The container can host an SSH console. It is enabled by setting `ENABLE_SSH` to
66
The SSH server only supports password based authentication. The password is the same as the RCON password.
77

88
!!! question
9-
See [the RCON password](../configuration/server-properties.md/#rcon-password) section under configuration/server-properties for more information on how to set an RCON password.
9+
See [the RCON password](../configuration/server-properties.md#rcon-password) section under configuration/server-properties for more information on how to set an RCON password.
1010

1111
The SSH server runs on port `2222` inside the container.
1212

@@ -15,7 +15,7 @@ The SSH server runs on port `2222` inside the container.
1515
!!! warning "Security Implications"
1616
By default, publishing ports in Docker binds them to all network interfaces (`0.0.0.0`), making the SSH console accessible to any device that can reach your host machine.
1717
18-
Since the SSH console grants **full administrative access** to your server, it is critical to use a strong [RCON password](../configuration/server-properties.md/#rcon-password).
18+
Since the SSH console grants **full administrative access** to your server, it is critical to use a strong [RCON password](../configuration/server-properties.md#rcon-password).
1919
2020
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing/#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:2222:2222`).
2121

docs/sending-commands/websocket.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ When a connection is established, the last 50 (by default, configurable with `WE
2626
!!! warning "Security Implications"
2727
By default, publishing ports in Docker binds them to all network interfaces (`0.0.0.0`), making the WebSocket console accessible to any device that can reach your host machine.
2828
29-
Since the WebSocket console grants **full administrative access** to your server, it is critical to use a strong [WebSocket password](#password) or [RCON password](../configuration/server-properties.md/#rcon-password).
29+
Since the WebSocket console grants **full administrative access** to your server, it is critical to use a strong [WebSocket password](#password) or [RCON password](../configuration/server-properties.md#rcon-password).
3030
31-
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing/#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:80:80`).
31+
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:80:80`).
3232
3333
If WebSocket access is only intended for inter-container connections, consider **NOT** forwarding the port to the host machine, and putting the containers in a shared [Docker network](https://docs.docker.com/engine/network/#user-defined-networks).
3434

0 commit comments

Comments
 (0)