Developing with Extend Dev Containers
Overview
Dev Containers provide an alternative development workflow for Extend apps that eliminates the need to manually install and configure development tools on your local machine. By using a containerized development environment, you can ensure consistency across different operating systems and team members, while reducing setup complexity and potential environment-related issues.
This guide covers how to use Dev Containers with Extend app templates, including setup, workflow, and best practices. Dev Containers are particularly useful for teams wanting consistent environments, developers new to Extend app development, and cross-platform development teams.
Dev Containers are an alternative to the traditional development workflow described in the Extend app development workflow. Both approaches achieve the same result, but Dev Containers provide a more isolated and consistent environment.
Prerequisites
Before using Dev Containers with Extend apps, ensure you have the following installed:
- Visual Studio Code (VS Code) or Cursor - A code editor that supports Dev Containers
- Download from code.visualstudio.com or cursor.com
- Dev Containers extension - Install the Remote - Containers extension for VS Code or the Dev Containers extension for Cursor.
- Docker Desktop - Required to run the development containers
- For Windows: Docker Desktop v4.30+ (Installation guide)
- For macOS: Docker Desktop (Installation guide)
- For Linux: Docker Engine v23.0+ (Installation guide)
- Git - For cloning Extend app templates
Dev Containers work with other IDEs that support the Dev Containers specification, such as GitHub Codespaces. The workflow is similar across different environments.
Dev Containers Workflow
If you only need the quick-start version of these steps, refer to the Dev Containers workflow summary. The sections below expand on each step in detail.
1. Clone the Extend App Template
Start by cloning an Extend app template from GitHub. The template already includes Dev Container configuration files (.devcontainer/devcontainer.json), so no additional setup is required.
git clone https://github.com/AccelByte/extend-service-extension-go
cd extend-service-extension-go
Dev Container support matrix
You can use any of the official Extend app templates depending on your language and use case. Link to this matrix from other docs instead of duplicating it.
2. Open in VS Code with Dev Containers
-
Open the project folder in VS Code:
code . -
When VS Code detects the
.devcontainerfolder, it will prompt you to reopen the folder in a container. ClickReopen in Containerwhen prompted.Alternatively, you can manually trigger this by:
- Pressing
Ctrl+Shift+P(orCmd+Shift+Pon macOS) - Typing
Dev Containers: Reopen in Container - Selecting the command
- Pressing
-
VS Code will build and start the development container. This process may take a few minutes the first time as it downloads the base image and installs dependencies.
The Dev Container configuration includes all necessary tools pre-installed, such as:
- Bash
- Make
- Language-specific build tools (Go, Python, Java, or .NET depending on the template)
- Docker-in-Docker support (if needed for building container images)
- Development dependencies
- Extend Helper CLI
Using GitHub Codespaces
Prefer a zero-install approach? Open the template repository on GitHub, select Code → Codespaces → Create codespace, and GitHub Codespaces will build the same .devcontainer environment in the cloud. You get identical tooling, VS Code settings, and MCP configuration without running Docker locally.
3. Development Environment Setup
Once the container is running, your development environment is automatically configured:
- Pre-configured tools: All required development tools are installed and ready to use
- Environment variables: The container includes necessary environment variables for development
- Volume mounts: Your project files are mounted into the container, so changes are reflected immediately
- Extensions: VS Code extensions specified in the Dev Container configuration are automatically installed
- VS Code configuration files: The Extend app templates include pre-configured VS Code files such as
tasks.jsonfor common operations,launch.jsonfor debugging, andmcp.jsonfor AI-powered development assistance via Model Context Protocol (MCP) servers
To use the MCP servers configured in mcp.json, you may need to configure them in VS Code. For detailed setup instructions, refer to the VS Code MCP documentation and the MCP servers guide. The shared MCP configuration file is available at mcp.json in the Extend app templates.
You can verify the environment is set up correctly by checking installed tools:
bash --version
make --version
docker --version
extend-helper-cli --help
4. Build and Test
With the Dev Container running, you can build and test your Extend app using the same commands as the traditional workflow:
# Build the application
make build
# Run tests
make test
# Generate gRPC code
make proto
The build process works exactly the same as in the traditional workflow, but everything runs inside the isolated container environment.
5. Customization
Customize your Extend app following the same steps as the traditional workflow:
- Modify gRPC service definitions: Edit
.protofiles to define your service methods - Implement gRPC methods: Write your business logic in the appropriate language
- Add dependencies: Update dependency files (
go.mod,requirements.txt,build.gradleorpom.xml,*.csproj, etc.) - Configure environment variables: Set up variables and secrets as needed
The customization process is identical to the traditional workflow—only the development environment differs.
If you need to customize the Dev Container itself (e.g., add additional tools or change the base image), edit the .devcontainer/devcontainer.json file. Changes will take effect after rebuilding the container.
6. Deploy
Deployment follows the same process as the traditional workflow:
-
Build the container image:
docker build -t your-app:latest . -
Push to AccelByte Gaming Services:
- Using VS Code Tasks (Recommended): Use the pre-configured VS Code tasks that use
extend-helper-clito upload the image. These tasks are available in the Extend app templates and let you useextend-helper-cliwithout manually typing commands. Access them via:- Press
Ctrl+Shift+P(orCmd+Shift+Pon macOS) - Type
Tasks: Run Task - Select tasks like
Extend: Create App,Extend: Login to Docker,Extend: Build and Upload Image,Extend: Deploy, etc.
- Press
- Using
extend-helper-clidirectly: Run the commands manually in the terminal
- Using VS Code Tasks (Recommended): Use the pre-configured VS Code tasks that use
-
Deploy from Admin Portal:
- Navigate to your Extend app in the Admin Portal
- Configure variables and secrets
- Deploy the app
The Extend app templates include VS Code tasks that simplify using extend-helper-cli. These tasks handle common operations like creating the app, building and uploading images, deploying apps, and managing app lifecycle. See the .vscode/tasks.json file in the templates for the full list of available tasks.
For detailed deployment instructions, refer to the specific Extend app type guides:
Benefits of Dev Containers
Using Dev Containers for Extend app development offers several advantages:
- Consistent environments: All team members work in identical development environments, reducing "works on my machine" issues
- Reduced setup complexity: No need to manually install Bash, Make, Docker, or language-specific tools
- Cross-platform compatibility: Works seamlessly on Linux, Windows, and macOS
- Isolated environment: Development tools don't affect your host system
- Easy reset: Rebuild the container to get a fresh environment anytime
- Version control: Dev Container configuration is version-controlled with your project
When to Use Dev Containers
Consider using Dev Containers when:
- You want a consistent development environment across your team
- You're new to Extend app development and want to avoid setup complexity
- You're working on multiple projects with different tool requirements
- You want to isolate development tools from your host system
- You're developing on Windows and want a Linux-like environment without WSL2 complexity
Customizing the Dev Container
The Dev Container configuration is located in .devcontainer/devcontainer.json. You can customize it to:
- Change the base image
- Install additional tools or packages
- Configure environment variables
- Set up port forwarding
- Install additional VS Code extensions
Example .devcontainer/devcontainer.json:
{
"name": "Example Dev Container",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.go",
"golang.go"
]
}
},
"forwardPorts": [8080, 9090],
"postCreateCommand": "make install"
}
After modifying the configuration, rebuild the container:
- Press
Ctrl+Shift+P(orCmd+Shift+Pon macOS) - Type
Dev Containers: Rebuild Container - Select the command
Troubleshooting
Container fails to start
- Ensure Docker Desktop is running
- Check Docker logs:
docker ps -ato see container status - Verify the
.devcontainer/devcontainer.jsonfile is valid JSON
Build commands fail
- Ensure you're inside the container (check the VS Code status bar)
- Rebuild the container to ensure all dependencies are installed
- Check that the Dev Container has the required tools installed
Performance issues
- Allocate more resources to Docker Desktop (CPU and memory)
- Use volume mounts efficiently (exclude
node_modules,.git, etc. if not needed) - Consider using a more lightweight base image
Port forwarding issues
- Check that ports are correctly configured in
devcontainer.json - Ensure no other services are using the same ports
- Verify firewall settings allow port forwarding
Integration with Existing Workflows
Dev Containers work seamlessly with:
- Git: All Git operations work normally inside the container
- CI/CD: Your CI/CD pipelines remain unchanged
- extend-helper-cli: Works the same way inside the container
- Docker builds: Docker-in-Docker support allows building images from within the container
Next Steps
After setting up your Dev Container environment:
- Review the Extend app development workflow to keep both workflows aligned.
- Follow the specific Extend app type guide for your use case:
- Configure AI assistance by following the MCP Servers guide; both guides reference the same
.vscode/mcp.json. - Learn about advanced topics:
- Explore the official templates on GitHub (for example, extend-service-extension-go) to reuse the curated
.devcontainerand.vscodeassets. - Set up your IAM client permissions and configure variables/secrets as described in the Extend app type guides.
With Dev Containers, you have a consistent, isolated development environment that makes Extend app development smoother and more reliable.