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

Add docker image for goose #1115

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,27 @@ jobs:
with:
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}
path: ${{ env.ARTIFACT }}

build-docker:
name: Build and Publish Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/goose:${{ inputs.version }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,31 @@ jobs:
allowUpdates: true
omitBody: true
omitPrereleaseDuringUpdate: true

# ------------------------------------
# 5) Build and Publish Docker Image
# ------------------------------------
build-docker:
name: Build and Publish Docker Image
runs-on: ubuntu-latest
needs: [build-cli]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/goose:${{ github.ref_name }}
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use a multi-stage build to compile the goose binary and create a minimal image

# Stage 1: Build the goose binary
FROM rust:1.56 as builder

WORKDIR /app

# Copy the source code
COPY . .

# Build the goose binary
RUN cargo build --release --package goose-cli

# Stage 2: Create a minimal image
FROM debian:buster-slim

WORKDIR /app

# Copy the goose binary from the builder stage
COPY --from=builder /app/target/release/goose /usr/local/bin/goose

# Set the entrypoint to the goose binary
ENTRYPOINT ["goose"]
20 changes: 20 additions & 0 deletions documentation/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ import RateLimits from '@site/src/components/RateLimits';
```
</TabItem>

<TabItem value="docker" label="Docker">
Run the following command to pull the Goose Docker image from Docker Hub:

```sh
docker pull block/goose:latest
```

To run Goose in a Docker container, use the following command:

```sh
docker run --rm -it block/goose:latest
```
</TabItem>

</Tabs>

:::tip Updating Goose
Expand Down Expand Up @@ -224,6 +238,12 @@ Goose works with a set of [supported LLM providers][providers], and you’ll nee

Type your questions, tasks, or instructions directly into the input field, and Goose will get to work immediately.
</TabItem>
<TabItem value="docker" label="Docker">
To run Goose in a Docker container, use the following command:
```sh
docker run --rm -it block/goose:latest
```
</TabItem>
</Tabs>

## Additional Resources
Expand Down