mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 15:20:40 +00:00
feat: custom docker entrypoint
This commit is contained in:
@@ -125,3 +125,52 @@ test('ConvertGpusWithQuotes', function () {
|
||||
],
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointSimple', function () {
|
||||
$input = '--entrypoint /bin/sh';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => '/bin/sh',
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointWithEquals', function () {
|
||||
$input = '--entrypoint=/bin/bash';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => '/bin/bash',
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointWithArguments', function () {
|
||||
$input = '--entrypoint "sh -c npm install"';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => 'sh -c npm install',
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointWithSingleQuotes', function () {
|
||||
$input = "--entrypoint 'memcached -m 256'";
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => 'memcached -m 256',
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointWithOtherOptions', function () {
|
||||
$input = '--entrypoint /bin/bash --cap-add SYS_ADMIN --privileged';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toHaveKeys(['entrypoint', 'cap_add', 'privileged'])
|
||||
->and($output['entrypoint'])->toBe('/bin/bash')
|
||||
->and($output['cap_add'])->toBe(['SYS_ADMIN'])
|
||||
->and($output['privileged'])->toBe(true);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointComplex', function () {
|
||||
$input = '--entrypoint "sh -c \'npm install && npm start\'"';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => "sh -c 'npm install && npm start'",
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user