Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish a Dockerfile or include it in the standard nats-io file #52

Open
disarticulate opened this issue Mar 22, 2023 · 4 comments
Open

Comments

@disarticulate
Copy link

Trying to put some containers together, and find it odd that I need go to build a tool to secure nats.

Why not provide either:

  1. A binary inside the nats-io dockerfiles
    or
  2. A Dockerfile that builds the binary.

I'm not a go programmer but certainly appreciate whenever I can build a product like this without having to install all the dev tools inside a docker or my own shell.

@derekcollison
Copy link
Member

Which binary are you referring to?

In general folks use the NATS cli and nsc..

@disarticulate
Copy link
Author

disarticulate commented Mar 23, 2023

Not sure. When I got to the manual https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt#what-are-nkeys it looks like they're talking about nats.

a single line docker command looks like:
docker run golang:latest bash -c "go install github.com/nats-io/nkeys/nk@latest && nk -gen user"

Dockerfile then is something like

FROM golang:latest
RUN go install github.com/nats-io/nkeys/nk@latest
CMD ["nk"]

Just seems odd (to someone who doesnt Go) to recommend compile a custom key gen. Why wouldn't this just be a command in nats. Obviously there's ways around it, but if it's party of the security system, perhaps the main nats build should include it?

@derekcollison
Copy link
Member

That utility is for creating custom nkeys and in general is not needed at all for normal operations.

/cc @bruth

@bruth
Copy link
Member

bruth commented Mar 24, 2023

@disarticulate Can you describe what your desired end state is? Based on the page you linked to, you are wanting to setup the decentralized (JWT-based) auth? The page is an in-depth guide that gets into the weeds, including discussing what nkeys are and how they related to this auth mode, but as Derek said, it is not required to use the nk to make anything manually.

The nsc tool is used to bootstrap the operator, system account, and server config as well as manage accounts and users. This includes generating nkeys and the JWTs.

In terms of a container, there is nats-box which packages up the CLI, nsc, and nats-top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants