File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -531,10 +531,13 @@ class Client
531531
532532 /**
533533 * @param array $cmd [ "nginx", "-g", "daemon off;"]
534+ * null => 默认值,Dockerfile 中指定的值
535+ * [] => 默认值,Dockerfile 中指定的值
536+ * [""] => ""
534537 *
535538 * @return Client
536539 */
537- public function setCmd (?array $ cmd )
540+ public function setCmd (?array $ cmd = null )
538541 {
539542 $ this ->cmd = $ cmd ;
540543
@@ -820,10 +823,13 @@ public function setWorkingDir(string $workingDir)
820823
821824 /**
822825 * @param array $entrypoint ['/bin/sh', '-c']
826+ * [] => []
827+ * null => 默认值,Dockerfile 中指定的值
828+ * [""] => null
823829 *
824830 * @return Client
825831 */
826- public function setEntrypoint (?array $ entrypoint )
832+ public function setEntrypoint (?array $ entrypoint = null )
827833 {
828834 $ this ->entrypoint = $ entrypoint ;
829835
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function testList(): void
3535 public function testCreate ()
3636 {
3737 $ output = $ this ->client
38- ->setImage ('khs1994/ nginx:1.15 .3-alpine ' )
38+ ->setImage ('nginx:1.17 .3-alpine ' )
3939 ->setEnv (['a=1 ' ])
4040 ->setBinds (['/c:/c ' ])
4141 ->setPortBindings ([
@@ -47,6 +47,8 @@ public function testCreate()
4747 ],
4848 ])
4949 ->setLabels (['a ' => '1 ' ])
50+ ->setEntrypoint (null )
51+ ->setCmd (null )
5052 ->create ()
5153 ->start (null );
5254
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public function setUp(): void
2424 */
2525 public function testInfo (): void
2626 {
27- $ output = $ this ->client ->info ('khs1994/ nginx ' );
27+ $ output = $ this ->client ->info ('nginx ' );
2828
2929 $ this ->assertArrayHasKey ('Descriptor ' , json_decode ($ output , true ));
3030 }
You can’t perform that action at this time.
0 commit comments