From b070b67be5bbb7ffcd558179874c5402d3498640 Mon Sep 17 00:00:00 2001 From: ieugen Date: Fri, 27 Feb 2026 18:12:42 +0000 Subject: [PATCH] Improve usability for garage in container by setting entrypoint (#1363) - BREAKING: This update will probably break previous containers setups that expect you to provide `/garage` After the upgrade, instead of: docker run --rm dxflrs/garage:latest /garage --help you need to run docker run --rm dxflrs/garage:latest --help Signed-off-by: ieugen Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1363 Reviewed-by: Alex Co-authored-by: ieugen Co-committed-by: ieugen --- Dockerfile | 4 +++- doc/book/cookbook/real-world.md | 5 +++++ doc/book/quick-start/_index.md | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e301ee9..3fb5a015 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,6 @@ ENV RUST_BACKTRACE=1 ENV RUST_LOG=garage=info COPY result/bin/garage / -CMD [ "/garage", "server"] + +ENTRYPOINT ["/garage"] +CMD ["server"] diff --git a/doc/book/cookbook/real-world.md b/doc/book/cookbook/real-world.md index 73218132..eb08c7c6 100644 --- a/doc/book/cookbook/real-world.md +++ b/doc/book/cookbook/real-world.md @@ -213,7 +213,12 @@ If your configuration file is at `/etc/garage.toml`, the `garage` binary should You can also use an alias as follows to use the Garage binary inside your docker container: ```bash +# garage 3.x, we have an entrypoint and you can use +alias garage="docker exec -ti " + +# For garage 2.x, you need to specify the absolute path to binary alias garage="docker exec -ti /garage" + ``` You can test your `garage` CLI utility by running a simple command such as: diff --git a/doc/book/quick-start/_index.md b/doc/book/quick-start/_index.md index a50e92f5..56632be0 100644 --- a/doc/book/quick-start/_index.md +++ b/doc/book/quick-start/_index.md @@ -178,8 +178,11 @@ garage status If you are running Garage in a Docker container, you can use the following command instead: +NOTE: Garage 3.x uses docker `ENTRYPOINT` and it's easier to use, +while garage 2.x does not and you need to specify path `/garage` + ```bash -docker exec garage-container /garage status +docker exec garage-container status ``` This should show something like this: @@ -320,7 +323,7 @@ If you are running Garage in a Docker container, you can set the following alias to provide a fake `garage`command that uses the Garage binary inside your container: ```bash -alias garage="docker exec -ti /garage" +alias garage="docker exec -ti " ``` You can test that your `garage` CLI is configured correctly by running a basic command such as `garage status`.