-
Notifications
You must be signed in to change notification settings - Fork 76
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
Dockerise CLI and HTTP server #11
Conversation
@sbihel Looks great. I wonder why the Action ran for a previous commit (https://github.com/spruceid/didkit/runs/1454027244) but not for c95274b. (looking at https://github.com/spruceid/didkit/actions?query=workflow%3Apush_image) I'm having trouble running the containers.
From reading https://docs.github.com/en/free-pro-team@latest/packages/getting-started-with-github-container-registry/migrating-to-github-container-registry-for-docker-images, I made a GitHub PAT. But it still doesn't work:
Any ideas? |
Thanks for the review @clehner
It's because I had my branch in addition to
That's my bad. There's no Happy American Thanksgiving 🦃 |
Thanks @sbihel ! Makes sense. Still unable to run though:
Reading this suggests something is needed to make the container visible: |
Can you see the images listed here https://github.com/orgs/spruceid/packages/container/package/didkit-cli ? |
No, it shows 404 for me |
Ah, I was the only one to have access to the packages created with my PAT. I've given you read rights manually. |
Cool, it works now. Two other questions:
|
It's not really ergonomic to use files but feasible. You can share a volume
I'm still looking into it. It stops fine outside of the container, but it doesn't have any effect in the container. The signal passing is fine as |
How do we feel about adding environment variables to be read by the program, superseded by command line options if they are specified? We could pass a path to the key or possibly the key itself. see also clap-rs/clap#814 |
Also, I recommend that we add the ghcr login instructions into the README for now...we can remove once the images are public. |
Remains that I've tried all forms of CMD and ENTRYPOINT and nothing seems to work to pass the signals from the TTY. But it works with Adding environment variables support is easy with |
51d44ef
to
ccff559
Compare
Alright, now it's possible to use environment variables for arguments, and I added |
@sbihel Looks great. I think I read it may be possible to change the process's name/arguments by rewriting Anyway the command-line
The env var works:
The filename option returns the same correct result:
|
cli/README.md
Outdated
@@ -35,7 +35,8 @@ Given a Ed25519 [JWK][], output the corresponding [did:key][] [verificationMetho | |||
|
|||
#### Options | |||
|
|||
- `-k, --key <file>` (required) - Name of JWK file | |||
- `-k, --key-path <file>` (required) - Filename of JWK file | |||
- `-j, --jwk <jwk>` (required) - JWK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how it's written now implies that both are required, perhaps we could note the either-or-ness as we do below?
After trying many different things.... it looks like the I put a warning in the |
I think if you get multiple inputs, then we just following an order of precedence print a warning that we are ignoring values if other lower-tier values are also specified. The following order seems to be pretty standard:
|
That's already the case, expect that we don't have a config file yet. |
Dockerised the CLI and the HTTP server CLI, making them usable like with
cargo install
but without having to install Rust and compiling them.The image are built and pushed automatically for the
main
branch and releases, with a Github action and stored in the Github Container registry (ghcr.io
).