@@ -31,7 +31,7 @@ const HTTP_TOOLKIT_INJECTED_CA_PATH = path.posix.join(HTTP_TOOLKIT_INJECTED_PATH
31
31
*
32
32
* On Linux this is _not_ supported, so we add it ourselves with (--add-host).
33
33
*/
34
- export const DOCKER_HOST_HOSTNAME = "host.docker.internal" ;
34
+ export const HTTP_TOOLKIT_DOCKER_HOSTNAME = "http-toolkit- host.docker.internal" ;
35
35
36
36
/**
37
37
* To make the above hostname work on Linux, where it's not supported by default, we need to map it to the
@@ -41,7 +41,7 @@ export const getDockerHostIp = (platform: typeof process.platform, dockerVersion
41
41
if ( platform !== 'linux' ) {
42
42
// On non-linux platforms this method isn't necessary - host.docker.internal is always supported
43
43
// so we can just use that.
44
- return DOCKER_HOST_HOSTNAME ;
44
+ return "host.docker.internal" ;
45
45
} else if ( dockerVersion &&
46
46
semver . satisfies ( semver . coerce ( dockerVersion ) ?. version ?? '0.0.0' , '>=1.21' )
47
47
) {
@@ -162,17 +162,11 @@ export function transformContainerCreationConfig(
162
162
}
163
163
: { }
164
164
) ,
165
- ...( process . platform === 'linux'
166
- // On Linux only, we need to add an explicit host to make host.docker.internal work:
167
- ? {
168
- ExtraHosts : [
169
- `${ DOCKER_HOST_HOSTNAME } :${ proxyHost } ` ,
170
- // Seems that first host wins conflicts, so we go before existing values
171
- ...( currentConfig . HostConfig ?. ExtraHosts ?? [ ] )
172
- ]
173
- }
174
- : { }
175
- )
165
+ ExtraHosts : [
166
+ `${ HTTP_TOOLKIT_DOCKER_HOSTNAME } :${ proxyHost } ` ,
167
+ // Seems that first host wins conflicts, so we go before existing values
168
+ ...( currentConfig . HostConfig ?. ExtraHosts ?? [ ] )
169
+ ]
176
170
} ;
177
171
178
172
// Extend that config, injecting our custom overrides:
@@ -187,7 +181,7 @@ export function transformContainerCreationConfig(
187
181
{ certPath : HTTP_TOOLKIT_INJECTED_CA_PATH } ,
188
182
envArrayToObject ( currentConfig . Env ) ,
189
183
{
190
- httpToolkitIp : DOCKER_HOST_HOSTNAME ,
184
+ httpToolkitIp : HTTP_TOOLKIT_DOCKER_HOSTNAME ,
191
185
overridePath : HTTP_TOOLKIT_INJECTED_OVERRIDES_PATH ,
192
186
targetPlatform : 'linux'
193
187
}
0 commit comments