File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,3 +32,6 @@ my_config.json
3232.DS_Store
3333npm-debug.log
3434dist
35+
36+ # IDE Configuration files
37+ .idea
Original file line number Diff line number Diff line change @@ -549,6 +549,35 @@ docker.command('info').then(function (data) {
549549// registry: 'https://index.docker.io/v1/' } }
550550```
551551
552+ * docker search
553+
554+ ``` js
555+ docker .command (' search nginxcont' ).then (function (data ) {
556+ console .log (' data = ' , data);
557+ });
558+
559+ // data = {
560+ // command: 'docker search nginxcont ',
561+ // raw:
562+ // 'NAME DESCRIPTION STARS OFFICIAL AUTOMATED\nprotonyx76/nginxcontainer 0 \nddavie2323/nginxhelloworld NGINXContainer 0 \n',
563+ // images:
564+ // [{
565+ // name: 'protonyx76/nginxcontainer',
566+ // description: '',
567+ // stars: '0',
568+ // official: '',
569+ // automated: ''
570+ // },
571+ // {
572+ // name: 'ddavie2323/nginxhelloworld',
573+ // description: 'NGINXContainer',
574+ // stars: '0',
575+ // official: '',
576+ // automated: ''
577+ // }]
578+ // }
579+ ```
580+
552581## License
553582
554583MIT
Original file line number Diff line number Diff line change @@ -85,4 +85,14 @@ test('docker-cli-js', t => {
8585 } ) ;
8686 } ) ;
8787
88+ t . test ( 'search' , t => {
89+
90+ let docker = new Docker ( ) ;
91+
92+ return docker . command ( 'search nginxcont' ) . then ( function ( data ) {
93+ console . log ( 'data = ' , data ) ;
94+ t . ok ( data . images ) ;
95+ } ) ;
96+ } ) ;
97+
8898} ) ;
Original file line number Diff line number Diff line change @@ -117,9 +117,16 @@ const extractResult = function (result: any) {
117117 return resultp ;
118118 } ,
119119 } ,
120+ {
121+ re : / s e a r c h / ,
122+ run : function ( resultp : any ) {
123+ const lines = splitLines ( resultp . raw ) ;
120124
125+ resultp . images = cliTable2Json ( lines ) ;
121126
122-
127+ return resultp ;
128+ } ,
129+ } ,
123130 ] ;
124131
125132 extracterArray . forEach ( function ( extracter ) {
You can’t perform that action at this time.
0 commit comments