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

feat: add Docker support #1072 #1073

Closed
wants to merge 1 commit into from
Closed

Conversation

blevz
Copy link

@blevz blevz commented Feb 5, 2025

So goose + claude on openrouter basically one shotted this...

This commit adds Docker support to goose via a multi-stage Dockerfile that:

  • Uses rust:1.75 for building
  • Uses debian:bookworm-slim for runtime
  • Includes required system dependencies
  • Provides documentation for Docker usage

The Docker image allows running goose without installing Rust locally and provides a consistent runtime environment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this file for? i think we can remove it

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I think goose decided this was the right way to communicate the pr description, will remove

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think we can remove this file

Copy link
Author

Choose a reason for hiding this comment

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

+1

Dockerfile Outdated
@@ -0,0 +1,29 @@
# Build stage
FROM rust:1.75 as builder
Copy link
Author

Choose a reason for hiding this comment

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

Goose generated this file, I'm fiddling with it as it appears there are some other deps when attempting to retrieve credentials

@blevz blevz force-pushed the feature/docker-support branch from 7ec9784 to d1eb1ff Compare February 5, 2025 04:22
@blevz
Copy link
Author

blevz commented Feb 5, 2025

hitting this error with the created image, is there a way to build the cli w/o that functionality?

Failed to create provider: Failed to access keyring: Platform secure storage failure: DBus error: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

@da-moon
Copy link

da-moon commented Feb 5, 2025

You should be able to bind mount it from host os but usually people don't do that as dbus is for desktop only.

@da-moon
Copy link

da-moon commented Feb 5, 2025

I looked into the code a bit . You usually define feature in Cargo.toml file and you can choose what feature to enable / disable at completion with those. It seems like Goose has not done that so this might be a bit of a larger effort as you have to define split code functionality in the codebase and use features to tell the compiler what code path to include during build

E.g https://github.com/sharkdp/bat/blob/master/Cargo.toml

This commit adds Docker support to goose via a multi-stage Dockerfile that:
- Uses rust:1.75 for building
- Uses debian:bookworm-slim for runtime
- Includes required system dependencies
- Provides documentation for Docker usage

The Docker image allows running goose without installing Rust locally and
provides a consistent runtime environment.
@blevz blevz force-pushed the feature/docker-support branch from d1eb1ff to c919a19 Compare February 6, 2025 00:45
@blevz
Copy link
Author

blevz commented Feb 6, 2025

Got it working

goose % docker run -it -e OPENROUTER_API_KEY=$OPENROUTER_API_KEY -v ~/.config/goose:/root/.config/goose:rw goose /app/goose session 
starting session | provider: openrouter model: anthropic/claude-3.5-sonnet
    logging to /root/.config/goose/sessions/peewg7pa.jsonl

# Copy the binary from builder
COPY --from=builder /usr/src/goose/target/release/goose /app/goose

ENV GOOSE_KEYRING_BACKEND=file
Copy link
Collaborator

Choose a reason for hiding this comment

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

i don't think this env exists. you'd wanna set the keys as env vars when running the container

https://block.github.io/goose/docs/troubleshooting/#keychainkeyring-errors

Copy link
Collaborator

Choose a reason for hiding this comment

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

docker run -ti --rm --entrypoint=/bin/bash \
  -e DATABRICKS_HOST="$DATABRICKS_HOST" \
  -e DATABRICKS_TOKEN="$DATABRICKS_TOKEN" \
  goose

@salman1993
Copy link
Collaborator

@blevz this Dockerfile is working & i left a comment on how you can use it. We don't wanna officially support the Docker route right now so I am close out this PR for now.

@salman1993 salman1993 closed this Feb 6, 2025
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

Successfully merging this pull request may close these issues.

3 participants