diff --git a/configs/devkit/linux/agent/Ubuntu.devkit.Dockerfile b/configs/devkit/linux/agent/Ubuntu.devkit.Dockerfile index 8898c4e8e..edd47981e 100644 --- a/configs/devkit/linux/agent/Ubuntu.devkit.Dockerfile +++ b/configs/devkit/linux/agent/Ubuntu.devkit.Dockerfile @@ -10,7 +10,18 @@ FROM ${teamCityImage} USER root -RUN rm -rf /opt/buildagent/* +# Remove agent code sequentially to work around the inability to delete volumes from the base image. +RUN rm -rf '/opt/buildagent/bin' && \ + rm -rf '/opt/buildagent/tools' && \ + rm -rf '/opt/buildagent/system' && \ + rm -rf '/opt/buildagent/plugins' && \ + rm -rf '/opt/buildagent/temp' && \ + rm -rf '/opt/buildagent/work' && \ + rm -rf '/opt/buildagent/lib' && \ + rm -rf '/opt/buildagent/conf' && \ + rm -rf '/opt/buildagent/launcher' && \ + rm -rf '/data/teamcity_agent/conf' + USER buildagent CMD ["sleep", "infinity"] \ No newline at end of file diff --git a/tool/TeamCity.Docker/ConfigurationExplorer.cs b/tool/TeamCity.Docker/ConfigurationExplorer.cs index 7ba2b3b3c..708566414 100644 --- a/tool/TeamCity.Docker/ConfigurationExplorer.cs +++ b/tool/TeamCity.Docker/ConfigurationExplorer.cs @@ -9,6 +9,9 @@ namespace TeamCity.Docker using IoC; using Model; + /// + /// Locates configuration files for Docker Images. + /// internal class ConfigurationExplorer : IConfigurationExplorer { [NotNull] private readonly ILogger _logger; @@ -21,7 +24,7 @@ public ConfigurationExplorer( _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); } - + public Result> Explore(string sourcePath, IEnumerable configurationFiles) { if (sourcePath == null) @@ -95,9 +98,10 @@ private IEnumerable