Merge pull request #9884 from Fs00/autoremove-containers
Autoremove containers launched by DockerContainerRunner
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-common': patch
|
||||
---
|
||||
|
||||
DockerContainerRunner.runContainer now automatically removes the container when its execution terminates
|
||||
@@ -115,6 +115,7 @@ describe('DockerContainerRunner', () => {
|
||||
Env: envVarsArray,
|
||||
WorkingDir: workingDir,
|
||||
HostConfig: {
|
||||
AutoRemove: true,
|
||||
Binds: expect.arrayContaining([
|
||||
`${path.join(rootDir, 'input')}:/input`,
|
||||
`${path.join(rootDir, 'output')}:/output`,
|
||||
@@ -207,6 +208,7 @@ describe('DockerContainerRunner', () => {
|
||||
logStream,
|
||||
expect.objectContaining({
|
||||
HostConfig: {
|
||||
AutoRemove: true,
|
||||
Binds: [],
|
||||
},
|
||||
Volumes: {},
|
||||
|
||||
@@ -105,6 +105,7 @@ export class DockerContainerRunner implements ContainerRunner {
|
||||
await this.dockerClient.run(imageName, args, logStream, {
|
||||
Volumes,
|
||||
HostConfig: {
|
||||
AutoRemove: true,
|
||||
Binds,
|
||||
},
|
||||
...(workingDir ? { WorkingDir: workingDir } : {}),
|
||||
|
||||
Reference in New Issue
Block a user