public static DockerCommandSocket createAndStart(String socketPath, TerminalInterface terminal) {
        DockerCommandSocket socket = null;

        try {
            Path path = Paths.get(socketPath);
            Files.deleteIfExists(path);

            ServerSocketChannel channel = ServerSocketChannel.open(StandardProtocolFamily.UNIX);
            channel.bind(UnixDomainSocketAddress.of(path));

            socket = new DockerCommandSocket(channel, terminal::runCommand);

            Thread thread = new Thread(socket, "docker-command-socket");
            thread.setDaemon(true);
            thread.start();
        } catch (Exception e) {
            LOGGER.error("Error starting docker command socket", e);
        }

        return socket;
    }
Simple/dumb unix domain socket that listens for connections,
reads the input to a string, then executes it as a command.

<p>Combined with a small sh/nc program, this makes it easy to execute
commands against a standalone instance of LP in a Docker container.</p>
standalone/app/src/main/java/me/lucko/luckperms/standalone/app/utils/DockerCommandSocket.java