Skip to content

feat: add container definitions#7798

Open
rbnis wants to merge 1 commit intousebruno:mainfrom
rbnis:feature/add-container
Open

feat: add container definitions#7798
rbnis wants to merge 1 commit intousebruno:mainfrom
rbnis:feature/add-container

Conversation

@rbnis
Copy link
Copy Markdown

@rbnis rbnis commented Apr 19, 2026

Description

This PR adds a Dockerfile for build a container image.

Additionally a readme.md file is added for basic documentation. Maybe the links to need to be adjusted based on the registry and container name that should be used.

Currently no pipeline definitions are part of this PR, since im not sure about the release processes used.

Closes #1415

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features

    • Introduced Docker containerization support, enabling users to run the Bruno CLI in a containerized environment with pre-built images available.
  • Documentation

    • Added comprehensive documentation covering image setup, building locally, version configuration, and executing CLI commands within containers.

Copilot AI review requested due to automatic review settings April 19, 2026 08:37
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Walkthrough

This pull request adds Docker containerization support for the Bruno CLI, introducing a Dockerfile based on Alpine Node, npm-installed Bruno CLI with configurable versioning, non-root user execution, a .dockerignore for build context optimization, and comprehensive usage documentation.

Changes

Cohort / File(s) Summary
Docker Container Setup
container/.dockerignore, container/Dockerfile, container/readme.md
Adds complete Docker containerization for Bruno CLI including Alpine-based Node image with non-root nobody user, globally installed CLI with BRUNO_VERSION build-time customization, build context exclusions, and usage documentation with examples for pulling, building, and running containers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐳 A tiny Alpine image, lean and bright,
Bruno CLI packaged, ready for flight,
No-root by design, secured just right,
From desktop to clouds, containerized light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add container definitions' accurately summarizes the main change: adding Docker-related files (Dockerfile, .dockerignore, and documentation).
Linked Issues check ✅ Passed The PR directly addresses issue #1415 by providing a Dockerfile and documentation for running Bruno via Docker, fulfilling the request for container support.
Out of Scope Changes check ✅ Passed All changes (Dockerfile, .dockerignore, readme.md) are directly scoped to providing Docker container support as specified in issue #1415.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
container/Dockerfile (1)

4-4: Remove unnecessary chown operation.

Since the Dockerfile doesn't COPY any files during build, changing ownership of the empty /bruno directory has no effect. Volume mounts at runtime will override any image-layer ownership. This line can be safely removed.

♻️ Proposed simplification
 WORKDIR /bruno
-RUN chown -R nobody:nobody /bruno
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@container/Dockerfile` at line 4, Remove the no-op ownership change by
deleting the RUN chown -R nobody:nobody /bruno instruction from the Dockerfile;
since no files are copied into /bruno during build and runtime volumes will
override image-layer ownership, simply remove the RUN chown line (referenced
here as the RUN chown -R nobody:nobody /bruno command) to simplify the
Dockerfile.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@container/readme.md`:
- Around line 34-37: The README currently only shows the Unix-style docker run
with -v "$(pwd):/bruno"; add Windows-compatible examples for cmd.exe and
PowerShell by including the equivalent docker run commands using "%cd%:/bruno"
for cmd.exe and "${PWD}:/bruno" for PowerShell alongside the existing Unix
example, and update the explanatory line after the docker run snippet (the mount
description) to state that the examples show how to mount the current directory
on macOS/Linux, Windows cmd.exe, and Windows PowerShell; reference the existing
docker run line and its mount explanation so the new examples appear in the same
section.

---

Nitpick comments:
In `@container/Dockerfile`:
- Line 4: Remove the no-op ownership change by deleting the RUN chown -R
nobody:nobody /bruno instruction from the Dockerfile; since no files are copied
into /bruno during build and runtime volumes will override image-layer
ownership, simply remove the RUN chown line (referenced here as the RUN chown -R
nobody:nobody /bruno command) to simplify the Dockerfile.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a56f2e6d-bb9f-454c-afa0-9ffe29d0f031

📥 Commits

Reviewing files that changed from the base of the PR and between c6281d3 and 37ff347.

📒 Files selected for processing (3)
  • container/.dockerignore
  • container/Dockerfile
  • container/readme.md

Comment thread container/readme.md
Comment on lines +34 to +37
docker run --rm -v "$(pwd):/bruno" ghcr.io/usebruno/bruno-cli run <collection>
```

> `-v $(pwd):/bruno` mounts your current directory into the working directory of the container.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Provide Windows-compatible volume mount examples.

The $(pwd) syntax is Unix-specific and won't work on Windows cmd.exe. Since Bruno is cross-platform, the documentation should include Windows alternatives.

📝 Proposed enhancement
 You can run any `bru` command. For example, to run a collection:

+**Linux/macOS:**
 ```sh
 docker run --rm -v "$(pwd):/bruno" ghcr.io/usebruno/bruno-cli run <collection>

+Windows (cmd.exe):
+cmd +docker run --rm -v "%cd%:/bruno" ghcr.io/usebruno/bruno-cli run <collection> +
+
+Windows (PowerShell):
+powershell +docker run --rm -v "${PWD}:/bruno" ghcr.io/usebruno/bruno-cli run <collection> +
+

-v $(pwd):/bruno mounts your current directory into the working directory of the container.

</details>

As per coding guidelines, Bruno is cross-platform and runs on macOS, Windows, and Linux, so documentation should handle platform differences.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @container/readme.md around lines 34 - 37, The README currently only shows
the Unix-style docker run with -v "$(pwd):/bruno"; add Windows-compatible
examples for cmd.exe and PowerShell by including the equivalent docker run
commands using "%cd%:/bruno" for cmd.exe and "${PWD}:/bruno" for PowerShell
alongside the existing Unix example, and update the explanatory line after the
docker run snippet (the mount description) to state that the examples show how
to mount the current directory on macOS/Linux, Windows cmd.exe, and Windows
PowerShell; reference the existing docker run line and its mount explanation so
the new examples appear in the same section.


</details>

<!-- fingerprinting:phantom:triton:puma:4cc76aaf-233e-4a51-92e4-b88689c65af1 -->

<!-- This is an auto-generated comment by CodeRabbit -->

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial containerization assets for running the Bruno CLI via Docker, along with basic usage documentation, to address the “Run with Docker” request (#1415).

Changes:

  • Added container/Dockerfile to build a Bruno CLI container image.
  • Added container/readme.md with build/pull/run instructions.
  • Added container/.dockerignore for the container build context.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
container/Dockerfile Defines a Node-based image that installs @usebruno/cli and runs bru as a non-root user.
container/readme.md Documents expected registry image, build args, and example docker run usage.
container/.dockerignore Reduces build context content for container builds (when using container/ as the build context).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread container/readme.md
Comment on lines +5 to +11
## Pre-built images

Pre-built images are available at [ghcr.io/usebruno/bruno-cli](https://github.com/usebruno/bruno/pkgs/container/bruno-cli):

```sh
docker pull ghcr.io/usebruno/bruno-cli:latest
```
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README states that pre-built images are available at ghcr.io/usebruno/bruno-cli, but the repo currently doesn’t include any workflow/pipeline for building and publishing this image. Unless images already exist externally, this is likely inaccurate; consider rewording to “Once published…” (or removing the section) until a publishing workflow is added.

Copilot uses AI. Check for mistakes.
Comment thread container/readme.md
Comment on lines +13 to +17
## Build the image yourself

```sh
docker build -t bruno-cli .
```
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build command is ambiguous given the Dockerfile lives under container/. docker build -t bruno-cli . will only work if the user first cds into container/; from the repo root it will not pick up this Dockerfile (and container/.dockerignore also won’t apply). Suggest updating the docs to either explicitly cd container before building, or provide a root-safe command like using -f container/Dockerfile with build context container/.

Copilot uses AI. Check for mistakes.
Comment thread container/Dockerfile
@@ -0,0 +1,12 @@
FROM node:25.9.0-alpine3.22
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base image uses Node 25.9.0, but this repo pins Node via .nvmrc (.nvmrc:1 is v22.12.0, and CI uses node-version-file: '.nvmrc' in .github/workflows/npm-bru-cli.yml:29-32). Suggest basing the container on the same Node major/minor (e.g., node:22.x-alpine) to avoid runtime/CLI incompatibilities and to match the project’s supported Node version.

Suggested change
FROM node:25.9.0-alpine3.22
FROM node:22.12.0-alpine3.22

Copilot uses AI. Check for mistakes.
Comment thread container/Dockerfile
WORKDIR /bruno
RUN chown -R nobody:nobody /bruno

ARG BRUNO_VERSION=3.2.2
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BRUNO_VERSION defaults to 3.2.2, but the CLI package version in this repo is currently 1.16.0 (packages/bruno-cli/package.json). If 3.2.2 isn’t actually published, docker build will fail; if it is published, it’s still surprising drift. Suggest defaulting to the repo’s current CLI version or omitting the version to install the latest, and documenting the intended versioning strategy.

Suggested change
ARG BRUNO_VERSION=3.2.2
# Keep this default aligned with packages/bruno-cli/package.json; override at build time if needed.
ARG BRUNO_VERSION=1.16.0

Copilot uses AI. Check for mistakes.
@rbnis rbnis mentioned this pull request Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run with Docker

2 participants