I'm using org-mode + org-babel to execute Bash commands that execute Docker commands. Here's an example:
#+BEGIN_SRC sh :exports both :dir ~/Dev/Docker/sample
sudo docker build -t tompurl/nginx .
#+END_SRC
When I run this command within Emacs I get the following output:
+RESULTS:
| Sending | build | context | to | Docker | daemon | 4.096 | kB | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| Step | 1 | : | FROM | ubuntu:16.04 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| ---> | 104bec311bcd | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| Step | 2 | : | MAINTAINER | Tom | Purl | <tom@tompurl.com> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| ---> | Running | in | dcd4c9dca196 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| ---> | 282dcb00cc8b | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| Removing | intermediate | container | dcd4c9dca196 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| Step | 3 | : | ENV | REFRESHED_AT | 2017-01-03 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| ---> | Running | in | 5c0aef4cfeca | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| ---> | 6dc275877c48 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
This is just the first 10 lines, there are well over 100 in the total output. Notice how the output seems to be squeezed into a table.
Here's the output from the same command when executed from the command line:
$ sudo docker build .
Sending build context to Docker daemon 4.096 kB
Step 1 : FROM ubuntu:16.04
---> 104bec311bcd
Step 2 : MAINTAINER Tom Purl "<tom@tompurl.com>"
---> Using cache
---> 282dcb00cc8b
Step 3 : ENV REFRESHED_AT 2017-01-03
---> Using cache
---> 6dc275877c48
Step 4 : RUN apt-get -yqq update && apt-get -yqq install nginx
---> Using cache
---> 91a8bef9ea0b
Step 5 : RUN mkdir -p /var/www/html/website
---> Using cache
---> c28fa568b3c2
Step 6 : ADD global.conf /etc/nginx/conf.d/
---> Using cache
---> 365c3e022248
Step 7 : ADD nginx.conf /etc/nginx/nginx.conf
---> Using cache
---> 726d0c223e77
Step 8 : EXPOSE 80
---> Using cache
---> 9035336945b0
Successfully built 9035336945b0
Is there something that I'm doing to squeeze everything into a table like this?
:results verbatim
to the#+BEGIN_SRC
line. (The default is to guess if the output is tabular data nad make a table if it is, I guess Babel's guess is wrong in this case;verbatim
tells Babel the output is just literal text.) – Omar Jan 3 '17 at 19:28