Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-21766

Option to cleanup container if the Docker task failed to start it

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Summary

      When running a non-detached container in Bamboo using the Docker task, and the container fails to start, the Bamboo build will fail but the Docker container is not removed on completion of the task.

      There may be an error in the logs related to the command being executed inside the container but it will not hint that the container is not removed.

      Possible excessive disk usage may hint at the problem.

      https://confluence.atlassian.com/bamkb/docker-containers-are-not-removed-after-a-build-completes-720830717.html 

      Desired behaviour

      Cleanup the container if the Docker task failed to run.

      We would like to have an option to remove the container if the Docker Task failed to start a container.

      Workaround

      The leftover containers will not influence subsequent builds so may go unnoticed for some time. If the Docker service on the agent hasn't been restarted in a while this may lead to excessive disk usage. You can reclaim the disk space by manually removing the container using the docker rm command, for example:

      docker rm my-failed-container 

      Attachments

        Activity

          People

            Unassigned Unassigned
            661435e617fd Vani
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: