Quoting Adam Miller (2015-08-26 00:47:48) > Hello all, > I was curious if anyone knew of a way to capture effectively the > equivalent of stdout from 'docker build .' when using > atomic-reactor's python api? I'm not seeing how I would go about it > and thought I would just ask. > > I'm familiar with doing the following (with source predefined): > response = \ > build_image_using_hosts_docker( > "buildimage", > source, > "test-build" > ) > response.build_logs > > Which provides the logs from the atomic-reactor run inside the > container. I also found that using DockerTasker would allow me to > reference this same information, but I was curious if there's in > introspection point that allows to grab the following information: > > # docker build . > Sending build context to Docker daemon 105 kB > Sending build context to Docker daemon > Step 0 : FROM fedora:latest > ---> ded7cd95e059 > Step 1 : MAINTAINER http://fedoraproject.org/wiki/Cloud > ---> Using cache > ---> 9f97f024d47a > Step 2 : RUN dnf -y update && dnf clean all > ---> Using cache > ---> e5b0ea2b7754 > Step 3 : RUN dnf -y install httpd && dnf clean all > ---> Using cache > ---> 0c9f137f508c > Step 4 : RUN echo "Apache" >> /var/www/html/index.html > ---> Using cache > ---> 85461d238aef > Step 5 : EXPOSE 80 > ---> Using cache > ---> 7c08c855c39f > Step 6 : ADD run-apache.sh /run-apache.sh > ---> 83f8d7985d04 > Removing intermediate container c3107d502888 > Step 7 : RUN chmod -v +x /run-apache.sh > ---> Running in e0cce7c17116 > mode of '/run-apache.sh' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x) > ---> 93c019e967d6 > Removing intermediate container e0cce7c17116 > Step 8 : CMD /run-apache.sh > ---> Running in 6bd5a6cfc7f3 > ---> e6d701d7f85e > Removing intermediate container 6bd5a6cfc7f3 > Successfully built e6d701d7f85e > > Or even if there is such information available since atomic-reactor is > triggering builds from the docker.Client python api. > > If anyone has information about this they are willing to share, it > would be greatly appreciated. > > Thank you, > -AdamM >
Hi Adam, I was checking the code and it's not possible to do such thing at the moment. The way this could work is that we would take the information (output of `docker build .`), store it in a shared directory [1] and read it on a host once the build finishes. As you can see, the code is there but it's commented out (I checked `git blame` and it was me who commented it back in January -- looong time ago). Please file a RFE and we can work on it. Btw, what is the usecase of this feature? [1] https://github.com/projectatomic/atomic-reactor/commit/7a73a18c0af4bd99bfeacbd6ddd79914bd186184 Thanks! ~~ Tomáš Tomeček Software Engineer Developer Experience UTC+2 (CEST)
