mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-17 22:24:21 +01:00
docs: container use blog and guide (#2962)
Co-authored-by: Rizel Scarlett <rizel@squareup.com> Co-authored-by: Connor Braa <3478454+cwlbraa@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
---
|
||||
title: "Isolated Dev Environments in Goose with container-use"
|
||||
description: Never worry about breaking your development setup again with containerized, git-branch-isolated development environments powered by container-use
|
||||
authors:
|
||||
- mic
|
||||
tags: [extensions, containers, development, isolation, mcp, dagger]
|
||||
---
|
||||
|
||||

|
||||
|
||||
Over ten years ago, Docker came onto the scene and introduced developers en masse to the concept and practice of containers. These containers helped solve deployment and build-time problems, and in some cases, issues with development environments. They quickly became mainstream. The technology underlying containers included copy-on-write filesystems and lightweight, virtual-machine-like environments that helped isolate processes and simplify cleanup.
|
||||
|
||||
Dagger, the project and company founded by Docker’s creator [Solomon Hykes](https://www.linkedin.com/in/solomonhykes), has furthered the reach of containers for developers.
|
||||
|
||||
One project that emerged from this work is [Container Use](https://github.com/dagger/container-use), an MCP server that gives agents an interface for working in isolated containers and git branches. It supports clear lifecycles, easy rollbacks, and safer experimentation, without sacrificing the ergonomics developers expect from local agents.
|
||||
|
||||
Container Use brings containerized, git-branch-isolated development directly into your [Goose](/) workflow. While still early in its development, it's evolving quickly and already offers helpful tools for lightweight, branch-specific isolation when you need it.
|
||||
|
||||
<!-- truncate -->
|
||||
|
||||
## The Problem with Local-Only Development
|
||||
|
||||
Traditionally, developers build directly on their local machines, but that approach carries risks such as:
|
||||
|
||||
- Dependencies can conflict between projects
|
||||
- System changes might break other tools
|
||||
- Experimental code risks your stable codebase
|
||||
- Cleanup after failed experiments is tedious
|
||||
- Processes are left running, resources consumed that aren't freed
|
||||
- Changes are made which can't easily be undone
|
||||
|
||||
## A Safer Alternative: Isolated Development Environments
|
||||
|
||||
Container Use solves these problems by giving Goose the ability to work in completely isolated environments. Every experiment gets its own sandbox where nothing can affect your main development setup.
|
||||
|
||||
- **Git branch isolation**: Each experiment automatically gets its own git branch, keeping code changes separate from your main codebase.
|
||||
- **Container isolation**: Your code runs in clean, reproducible containers with exactly the dependencies it needs—nothing more, nothing less.
|
||||
- **Easy reset**: When you're done experimenting, simply exit the environment. No cleanup required, no residual changes to worry about.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### 1. Install Container Use
|
||||
|
||||
**macOS (recommended):**
|
||||
```bash
|
||||
brew install dagger/tap/container-use
|
||||
```
|
||||
|
||||
**All platforms:**
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash
|
||||
```
|
||||
|
||||
### 2. Add to Goose
|
||||
|
||||
Click this link to automatically add the extension:
|
||||
|
||||
**[🚀 Add Container Use to Goose](goose://extension?cmd=cu&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments)**
|
||||
|
||||
Or manually add to `~/.config/goose/config.yaml`:
|
||||
|
||||
```yaml
|
||||
extensions:
|
||||
container-use:
|
||||
name: container-use
|
||||
type: stdio
|
||||
enabled: true
|
||||
cmd: cu
|
||||
args:
|
||||
- stdio
|
||||
envs: {}
|
||||
```
|
||||
|
||||
## Real-World Use Cases
|
||||
|
||||
### Experimenting with New Dependencies
|
||||
|
||||
- **Prompt**: "I want to try adding Redis to this project, but I'm not sure if it's the right fit. Can you set up an isolated environment?"
|
||||
|
||||
- **Result**: Goose creates a new git branch, spins up a container with Redis, and lets you experiment. If it doesn't work out, simply exit—no cleanup needed.
|
||||
|
||||
### Risky Refactors
|
||||
|
||||
- **Prompt**: "I want to completely restructure this codebase, but I need to be able to roll back easily."
|
||||
|
||||
- **Result**: Work in an isolated branch and container where you can make sweeping changes without fear. Test your new architecture thoroughly. If the refactor succeeds, merge it back to main. If it fails, delete the branch and container.
|
||||
|
||||
### Learning New Technologies
|
||||
|
||||
- **Prompt**: "I want to try this new framework without installing dependencies on my main system."
|
||||
|
||||
- **Result**: Experiment in a pre-configured container with all the tools you need. Learn at your own pace without cluttering your host system or worrying about version conflicts.
|
||||
|
||||
### Split Testing Features
|
||||
|
||||
- **Prompt**: "I want to test two different approaches to this feature - one using a REST API and another with GraphQL. Can you run both experiments simultaneously?"
|
||||
|
||||
- **Result**: Goose spins up two isolated environments, each with its own git branch and container. One agent works on the REST implementation while another tackles GraphQL, both running in parallel without interfering with each other or your main codebase. Compare results and merge the winner.
|
||||
|
||||
## Guide
|
||||
|
||||
**[Get started with the full guide →](/docs/guides/isolated-development-environments)**
|
||||
|
||||
---
|
||||
|
||||
*Questions? Join our [GitHub discussions](https://github.com/block/goose) or [Discord](https://discord.gg/block-opensource). Learn more about Dagger at [dagger.io](https://dagger.io/).*
|
||||
|
||||
<head>
|
||||
<meta property="og:title" content="Isolated Dev Environments in Goose with container-use" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://block.github.io/goose/blog/2025/06/19/isolated-development-environments" />
|
||||
<meta property="og:description" content="Never worry about breaking your development setup again with containerized, git-branch-isolated development environments powered by container-use" />
|
||||
<meta property="og:image" content="https://block.github.io/goose/assets/images/sandbox-0b0f5e6f871cbf48ea1a0be243440aa1.png" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:domain" content="block.github.io/goose" />
|
||||
<meta name="twitter:title" content="Isolated Dev Environments in Goose with container-use" />
|
||||
<meta name="twitter:description" content="Never worry about breaking your development setup again with containerized, git-branch-isolated development environments powered by container-use" />
|
||||
<meta name="twitter:image" content="https://block.github.io/goose/assets/images/sandbox-0b0f5e6f871cbf48ea1a0be243440aa1.png" />
|
||||
</head>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 687 KiB |
@@ -15,6 +15,10 @@ Goose to a wide ecosystem of capabilities.
|
||||
Check out the [step-by-step tutorials](/docs/category/tutorials) for adding and using several Goose Extensions
|
||||
:::
|
||||
|
||||
:::tip Featured Extension
|
||||
Looking for isolated development environments? Check out our guide on [Isolated Development Environments](/docs/guides/isolated-development-environments) using the new container-use extension.
|
||||
:::
|
||||
|
||||
|
||||
## Built-in Extensions
|
||||
Out of the box, Goose is installed with a few extensions but with only the `Developer` extension enabled by default.
|
||||
|
||||
188
documentation/docs/guides/isolated-development-environments.md
Normal file
188
documentation/docs/guides/isolated-development-environments.md
Normal file
@@ -0,0 +1,188 @@
|
||||
---
|
||||
title: Isolated Development Environments
|
||||
sidebar_position: 25
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
This guide shows you how to set up isolated development environments using the **[Container Use MCP](https://github.com/dagger/container-use)** with Goose. With this setup, your development work will be isolated to both git branches and containers, allowing you to experiment freely without affecting your main system state.
|
||||
Note that the container-use MCP is very new and emerging, but offers powerful ways to do isolated development which are very agent friendly (build on tools like Docker, copy on write filesystems and more)
|
||||
|
||||
## Overview
|
||||
|
||||
The **[Container Use MCP](https://github.com/dagger/container-use)** server provides containerized development environments that integrate seamlessly with Goose. This allows you to:
|
||||
|
||||
- Work on changes isolated to git branches
|
||||
- Run code in containers without affecting your local machine
|
||||
- Easily reset and start fresh when needed
|
||||
- Maintain clean separation between different projects and experiments
|
||||
- Work on things in parallel
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker installed and running on your system
|
||||
- Git installed and configured
|
||||
- Goose installed and configured
|
||||
|
||||
## Installation
|
||||
|
||||
### Install Container Use
|
||||
|
||||
Head on over to the [Container Use README](https://github.com/dagger/container-use/blob/main/README.md) for up to date install instructions for this fast moving project.
|
||||
|
||||
## Adding to Goose
|
||||
|
||||
### Method 1: Quick Setup Link
|
||||
|
||||
Click this link to automatically add the extension to Goose:
|
||||
|
||||
**[Add Container-Use to Goose](goose://extension?cmd=cu&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments)**
|
||||
|
||||
### Method 2: Manual Configuration
|
||||
|
||||
<Tabs groupId="interface">
|
||||
<TabItem value="ui" label="Goose Desktop" default>
|
||||
|
||||
1. Click `...` in the top right corner of the Goose Desktop.
|
||||
2. Select `Advanced Settings` from the menu.
|
||||
3. Under `Extensions`, click `Add custom extension`.
|
||||
4. Fill in the details:
|
||||
- **Type**: `Standard IO`
|
||||
- **ID**: `container-use`
|
||||
- **Name**: `Container Use`
|
||||
- **Description**: `Use containers with dagger and git for isolated environments`
|
||||
- **Command**: `cu`
|
||||
- **Arguments**: `stdio`
|
||||
5. Click `Add` button
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="cli" label="Goose CLI">
|
||||
|
||||
1. Run the configuration command:
|
||||
```bash
|
||||
goose configure
|
||||
```
|
||||
|
||||
2. Select `Add Extension` from the menu.
|
||||
|
||||
3. Choose `Command-line Extension`.
|
||||
|
||||
4. Follow the prompts:
|
||||
- **Extension name**: `Container Use`
|
||||
- **Command**: `cu stdio`
|
||||
- **Timeout**: `300` (or your preferred timeout)
|
||||
- **Environment variables**: None needed
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="config" label="Config File">
|
||||
|
||||
Add the following configuration to your `~/.config/goose/config.yaml` file:
|
||||
|
||||
```yaml
|
||||
extensions:
|
||||
container-use:
|
||||
name: container-use
|
||||
type: stdio
|
||||
enabled: true
|
||||
cmd: cu
|
||||
args:
|
||||
- stdio
|
||||
envs: {}
|
||||
timeout: 300
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Usage
|
||||
|
||||
Once the extension is enabled in Goose, you can:
|
||||
|
||||
### Starting Isolated Development
|
||||
|
||||
Simply mention in your conversation with Goose that you want to work in an isolated environment:
|
||||
|
||||
```
|
||||
"I want to experiment with adding a new feature, but I want to do it in an isolated environment so I don't affect my main codebase."
|
||||
```
|
||||
|
||||
Goose will automatically:
|
||||
1. Create a new git branch for your work
|
||||
2. Set up a containerized environment
|
||||
3. Ensure all changes are isolated from your host system
|
||||
|
||||
### Working with Experiments
|
||||
|
||||
```
|
||||
"Let me try a completely different approach to this algorithm. Can you set up an isolated environment where I can experiment?"
|
||||
```
|
||||
|
||||
### Learning New Technologies
|
||||
|
||||
```
|
||||
"I want to try out this new framework, but I don't want to install all its dependencies on my main system."
|
||||
```
|
||||
|
||||
## Benefits
|
||||
|
||||
- **Safety**: Experiment without fear of breaking your main development environment
|
||||
- **Reproducibility**: Consistent environments across different machines and team members
|
||||
- **Isolation**: Multiple projects can run simultaneously without conflicts
|
||||
- **Easy cleanup**: Remove containers and branches when done
|
||||
- **Version control**: All changes are tracked in isolated git branches
|
||||
- **Rollback capability**: Easily discard failed experiments
|
||||
|
||||
## Common Workflows
|
||||
|
||||
### Feature Development
|
||||
|
||||
1. Start a conversation with Goose about a new feature
|
||||
2. Request isolated development environment
|
||||
3. Goose creates branch and container
|
||||
4. Develop and test the feature
|
||||
5. If successful, merge the branch; if not, discard it
|
||||
|
||||
### Dependency Exploration
|
||||
|
||||
1. Ask Goose to explore a new library or tool
|
||||
2. Work in isolated container with the dependency
|
||||
3. Test compatibility and functionality
|
||||
4. Decide whether to integrate into main project
|
||||
|
||||
### Refactoring
|
||||
|
||||
1. Request isolated environment for major refactoring
|
||||
2. Make changes in safety of container and branch
|
||||
3. Test thoroughly before merging
|
||||
4. Easy rollback if issues arise
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Docker not running:**
|
||||
- Ensure Docker Desktop is installed and running
|
||||
- Check Docker daemon status: `docker info`
|
||||
|
||||
**Permission issues:**
|
||||
- Ensure your user has permission to run Docker commands
|
||||
- On Linux, add user to docker group: `sudo usermod -aG docker $USER`
|
||||
|
||||
**Git issues:**
|
||||
- Ensure Git is properly configured with user name and email
|
||||
- Check that you're in a Git repository when starting isolated work
|
||||
|
||||
### Getting Help
|
||||
|
||||
If you encounter issues:
|
||||
|
||||
1. Check the **[Container Use GitHub repository](https://github.com/dagger/container-use)** for documentation
|
||||
2. Verify all prerequisites are installed and working
|
||||
3. Join our [Discord community](https://discord.gg/block-opensource) for support
|
||||
|
||||
## Next Steps
|
||||
|
||||
With container-use enabled in Goose, you're ready to develop with confidence. Try starting a conversation about a project you've been hesitant to experiment with, and let Goose set up a safe, isolated environment for your exploration.
|
||||
|
||||
Remember: with isolated environments, there's no such thing as a failed experiment—only learning opportunities that don't affect your main codebase.
|
||||
Reference in New Issue
Block a user