feat: support dns custom docker option
This commit is contained in:
parent
d87ab279fb
commit
6692ff3e36
3 changed files with 21 additions and 0 deletions
|
|
@ -1000,6 +1000,7 @@ function convertDockerRunToCompose(?string $custom_docker_run_options = null)
|
|||
'--ulimit',
|
||||
'--device',
|
||||
'--shm-size',
|
||||
'--dns',
|
||||
]);
|
||||
$mapping = collect([
|
||||
'--cap-add' => 'cap_add',
|
||||
|
|
@ -1013,6 +1014,7 @@ function convertDockerRunToCompose(?string $custom_docker_run_options = null)
|
|||
'--ip' => 'ip',
|
||||
'--ip6' => 'ip6',
|
||||
'--shm-size' => 'shm_size',
|
||||
'--dns' => 'dns',
|
||||
'--gpus' => 'gpus',
|
||||
'--hostname' => 'hostname',
|
||||
'--entrypoint' => 'entrypoint',
|
||||
|
|
|
|||
|
|
@ -733,6 +733,7 @@
|
|||
'--entrypoint "sh -c \'npm start\'"',
|
||||
'--entrypoint "sh -c \'php artisan schedule:work\'"',
|
||||
'--hostname "my-host"',
|
||||
'--dns 10.0.0.10 --dns=1.1.1.1',
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,24 @@
|
|||
]);
|
||||
});
|
||||
|
||||
test('ConvertDns', function () {
|
||||
$input = '--dns 10.0.0.10 --dns=1.1.1.1';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'dns' => ['10.0.0.10', '1.1.1.1'],
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertDnsWithOtherOptions', function () {
|
||||
$input = '--cap-add=NET_ADMIN --dns 10.0.0.10 --init';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'cap_add' => ['NET_ADMIN'],
|
||||
'dns' => ['10.0.0.10'],
|
||||
'init' => true,
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertPrivilegedAndInit', function () {
|
||||
$input = '---privileged --init';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
|
|
|
|||
Loading…
Reference in a new issue