File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ interface StartOptions {
9797 /** If docker enabled, docker image to run. @default " amazon/dynamodb-local" */
9898 dockerImage: string ,
9999
100+ /** If docker enabled, remove the container after stopping. @default false */
101+ dockerRemove: boolean ,
102+
100103 /** Folder where DynamoDB Local is installed to. @default " .dynamodb" */
101104 installPath: string ,
102105
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ export interface StartOptions {
4747 /** If docker enabled, docker image to run. @default "amazon/dynamodb-local" */
4848 dockerImage : string ,
4949
50+ /** If docker enabled, remove the container after stopping. @default false */
51+ dockerRemove : boolean ,
52+
5053 /** Folder where DynamoDB Local is installed to. @default ".dynamodb" */
5154 installPath : string ,
5255
@@ -68,6 +71,7 @@ const defaultOptions: StartOptions = {
6871 docker : false ,
6972 dockerPath : 'docker' ,
7073 dockerImage : 'amazon/dynamodb-local' ,
74+ dockerRemove : false ,
7175 installPath : defaultInstallPath ,
7276 install_path : undefined ,
7377} ;
@@ -115,7 +119,11 @@ export const start = async (customOptions?: Partial<StartOptions>): Promise<void
115119 }
116120
117121 const commonArgs = [ '-jar' , jarFilename , '-port' , String ( options . port ) ] ;
118- const dockerArgs = [ 'run' , '-p' , `${ options . port } :${ options . port } ` , options . dockerImage ] ;
122+ const dockerArgs = [ 'run' , '-p' , `${ options . port } :${ options . port } ` ] ;
123+ if ( options . dockerRemove ) {
124+ dockerArgs . push ( '-rm' ) ;
125+ }
126+ dockerArgs . push ( options . dockerImage ) ;
119127 if ( options . install_path ) {
120128 deprecation ( 'Use installPath instead of install_path' ) ;
121129 }
You can’t perform that action at this time.
0 commit comments