Skip to content
Open
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
7 changes: 7 additions & 0 deletions src/docker-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ describe('docker-manager', () => {
expect(agent.dns_search).toEqual([]);
});

it('should configure extra_hosts for host.docker.internal', () => {
const result = generateDockerCompose(mockConfig, mockNetworkConfig);
const agent = result.services.agent;

expect(agent.extra_hosts).toEqual(['host.docker.internal:host-gateway']);
});

it('should override environment variables with additionalEnv', () => {
const originalEnv = process.env.GITHUB_TOKEN;
process.env.GITHUB_TOKEN = 'original_token';
Expand Down
1 change: 1 addition & 0 deletions src/docker-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ export function generateDockerCompose(
},
dns: dnsServers, // Use configured DNS servers (prevents DNS exfiltration)
dns_search: [], // Disable DNS search domains to prevent embedded DNS fallback
extra_hosts: ['host.docker.internal:host-gateway'], // Enable host.docker.internal on Linux
volumes: agentVolumes,
environment,
depends_on: {
Expand Down
12 changes: 11 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,21 @@ export interface DockerService {

/**
* DNS search domains for the container
*
*
* Appended to unqualified hostnames during DNS resolution.
*/
dns_search?: string[];

/**
* Extra hosts to add to /etc/hosts in the container
*
* Array of host:ip mappings. Used to enable host.docker.internal
* on Linux where it's not available by default.
*
* @example ['host.docker.internal:host-gateway']
*/
extra_hosts?: string[];

/**
* Volume mount specifications
*
Expand Down
Loading