### Run nats-box Container with Docker Source: https://github.com/nats-io/nats-box/blob/main/README.md Launches the nats-box container interactively using Docker. Allows direct interaction with NATS commands like publishing messages. ```bash docker run --rm -it nats-io/nats-box:latest ~ # nats pub -s demo.nats.io test 'Hello World' 16:33:27 Published 11 bytes to "test" ``` -------------------------------- ### Run nats-box in Kubernetes (Interactive) Source: https://github.com/nats-io/nats-box/blob/main/README.md Deploys the nats-box container in Kubernetes for interactive use. Demonstrates subscribing to a subject and publishing messages. ```bash # Interactive mode kubectl run -i --rm --tty nats-box --image=natsio/nats-box --restart=Never nats-box:~# nats sub -s nats hello & nats-box:~# nats pub -s nats hello world ``` -------------------------------- ### Manage NATS Accounts with NSC and Docker Volume Mount Source: https://github.com/nats-io/nats-box/blob/main/README.md Runs the nats-box container with a Docker volume mount to persist NSC configurations (accounts, nkeys) on the host. Includes initializing NSC and showing the directory structure. ```bash docker run --rm -it -v $(pwd)/nsc:/nsc natsio/nats-box:latest # In case NSC not initialized already: nats-box:~# nsc init -d /nsc $ tree -L 2 nsc/ nsc/ ├── accounts │   ├── nats │   └── nsc.json └── nkeys ├── creds └── keys 5 directories, 1 file ``` -------------------------------- ### Deploy nats-box in Kubernetes (Non-Interactive) Source: https://github.com/nats-io/nats-box/blob/main/README.md Applies a Kubernetes manifest to deploy nats-box for non-interactive use and provides instructions to exec into the pod. ```bash # Non-interactive mode kubectl apply -f https://nats-io.github.io/k8s/tools/nats-box.yml kubectl exec -it nats-box -- /bin/sh ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.