Drop ENTRYPOINT in favor of CMD ["pass-cli"]
Every real caller (code.aneur.in/cloud/cloud's deploy workflows) runs a mounted-in script against pass-cli, not bare pass-cli args, so an ENTRYPOINT override was needed on every invocation. With no ENTRYPOINT, `docker run this-image sh /script.sh` just replaces CMD directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+8
-5
@@ -3,10 +3,13 @@
|
|||||||
# (fcntl64, __res_init, ...) that Alpine's gcompat/libc6-compat don't shim,
|
# (fcntl64, __res_init, ...) that Alpine's gcompat/libc6-compat don't shim,
|
||||||
# so it can't run in e.g. the docker:cli image directly.
|
# so it can't run in e.g. the docker:cli image directly.
|
||||||
#
|
#
|
||||||
# ENTRYPOINT is pass-cli itself, so `docker run this-image <args>` behaves
|
# No ENTRYPOINT -- just CMD ["pass-cli"]. `docker run this-image` runs bare
|
||||||
# like `pass-cli <args>`. Callers who need to run their own script against
|
# pass-cli; `docker run this-image <args>` replaces CMD entirely, so a
|
||||||
# pass-cli instead (login, fetch a note, parse it, etc.) override the
|
# caller running their own script against pass-cli (login, fetch a note,
|
||||||
# entrypoint: `docker run --entrypoint sh this-image /path/to/script.sh`.
|
# parse it, etc.) just does `docker run this-image sh /path/to/script.sh`
|
||||||
|
# with no --entrypoint override needed. The cost: `docker run this-image
|
||||||
|
# --version` doesn't work as shorthand -- write `docker run this-image
|
||||||
|
# pass-cli --version` instead.
|
||||||
|
|
||||||
FROM debian:bookworm-slim
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
@@ -26,4 +29,4 @@ RUN apt-get update \
|
|||||||
# No kernel keyring in a container -- store the session on disk instead.
|
# No kernel keyring in a container -- store the session on disk instead.
|
||||||
ENV PROTON_PASS_KEY_PROVIDER=fs
|
ENV PROTON_PASS_KEY_PROVIDER=fs
|
||||||
|
|
||||||
ENTRYPOINT ["pass-cli"]
|
CMD ["pass-cli"]
|
||||||
|
|||||||
@@ -20,22 +20,29 @@ its own glibc environment.
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The image's `ENTRYPOINT` is `pass-cli` itself:
|
There's no `ENTRYPOINT` -- just `CMD ["pass-cli"]`. Run bare:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run --rm code.aneur.in/cloud/pass-cli:<tag> --version
|
docker run --rm code.aneur.in/cloud/pass-cli:<tag>
|
||||||
```
|
```
|
||||||
|
|
||||||
To run your own script against `pass-cli` instead (login, fetch an item,
|
To run your own script against `pass-cli` instead (login, fetch an item,
|
||||||
parse the result, etc.), override the entrypoint and mount the script in:
|
parse the result, etc.), mount it in and pass it as the command -- it
|
||||||
|
replaces `CMD` entirely, no `--entrypoint` override needed:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-e PROTON_PASS_PERSONAL_ACCESS_TOKEN \
|
-e PROTON_PASS_PERSONAL_ACCESS_TOKEN \
|
||||||
-v "$PWD/my-script.sh:/script.sh:ro" \
|
-v "$PWD/my-script.sh:/script.sh:ro" \
|
||||||
--entrypoint sh \
|
|
||||||
code.aneur.in/cloud/pass-cli:<tag> \
|
code.aneur.in/cloud/pass-cli:<tag> \
|
||||||
/script.sh
|
sh /script.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
For one-off interactive use, prefix `pass-cli` explicitly, since args
|
||||||
|
replace `CMD` rather than appending to it:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run --rm code.aneur.in/cloud/pass-cli:<tag> pass-cli --version
|
||||||
```
|
```
|
||||||
|
|
||||||
`PROTON_PASS_KEY_PROVIDER` is set to `fs` in the image by default, since a
|
`PROTON_PASS_KEY_PROVIDER` is set to `fs` in the image by default, since a
|
||||||
|
|||||||
Reference in New Issue
Block a user