Access to workspace with docker build agent?

We have Jenkins installed on a Windows server and the docker host on a separate Linux server.
We have successfully configured Docker cloud templates and it properly creates a new container, executes the job and tears it down.
I would like to be able to access the workspace (and parser rules) after the container is torn down.
I believe binding or volumes are the proper method, but I’m missing something.

I’m also using Dockerfiles and not presently docker compose, so the random instructions out there get confusing.

  1. Is there a proper way to access the workspace in this configuration?
  2. Is there a proper way to mount the workspace to a volume …and how does jenkins know that that is the workspace?
  3. …or am I totally missing something with how logs and workspaces are expected to be used?

Any help would be greatly appreciated.

Thanks,
Eric

1 Like

Does anyone else have this problem? I feel like this problem would be more common unless I’ve gone down a different path than most.

Hello Eric, and welcome to this community :wave: .

I’m sorry but I don’t have the answer to your question.
I could test your configuration though…

Recommend also explaining why you need to access the workspace of a ephemeral build agent. By nature they are designed to be thrown away pretty quickly.

For example, if you want to keep an build artifact, you might want to use archive artifact step

1 Like

The primary reason for this is we’re using the ‘logParser’ plugin and the project rule option
e.g

logParser projectRulePath: 'concatenated_log_parser_rules.txt', showGraphs: true, \
                    failBuildOnError: true, unstableOnWarning: false, useProjectRule: true, parsingRulesPath: '' 

I could switch to a global rule, but was hoping to still be able to use the project-specific one in some way. It doesn’t seem like there is a way to configure this to a location not within the workspace…

Secondarily, it has been convenient on occasion to view all files in the workspace… To your point, I can export the convenient artifacts.