>
> I would like to record the Docker image id that was used for the job, and
> need to get this info from within the running job/container.
>
> I installed the Docker Traceablity plugin, and now when I view a build in
> the web gui, I see the Docker Fingerprints option on the left column, I
> select that and a page appears that seems to have exactly the info I want.
>
> How can I get that value programmatically?
From a shell script i use:
id=$(basename $(cat /proc/self/cpuset))
> Or get the image ID directly?
I don't know if Jenkins offers this service, and from within the
container, you would need to use "docker inspect".
If you're into python, checkout the docker python module:
http://docker-py.readthedocs.io/en/stable/index.html
If you bind mount /var/run/docker.sock in you container, then you can
access docker daemon.
And when I select that, I get this:
Which seems to have exactly the information I want.
I'm trying to find a way go access this data via the Jenkins API, to no avail.
If I could get it via the API, then I could make that same request inside my build job to get it as well.
I've spent several hours experimenting and web-searching, to no avail....
docker.image('maven:3-alpine').inside('-e IMAGE=\'maven:3-alpine\'') {Syntax is different for declarative where you use the 'args' tag.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e436006-ab3c-4bd5-9052-23f6ab4ae7d0%40googlegroups.com.