<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Representing Docker les in RDF</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Riccardo Tommasini</string-name>
          <email>riccardo.tommasini@polimi.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ben De Meester</string-name>
          <email>ben.demeester@ugent.be</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pieter Heyvaert</string-name>
          <email>pheyvaer.heyvaert@ugent.be</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ruben Verborgh</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Erik Mannens</string-name>
          <email>erik.mannens@ugent.be</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emanuele Della Valle</string-name>
          <email>emanuele.dellavalle@polimi.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ghent University</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>IDLab, Department of Electronics and Information Systems</institution>
          ,
          <addr-line>Ghent</addr-line>
          ,
          <country country="BE">Belgium</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Politecnico di Milano, DEIB</institution>
          ,
          <addr-line>Milan</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Containers { lightweight, stand-alone software executables { are everywhere. Industries exploit container managers to orchestrate complex cloud infrastructures and researchers in academia use them to foster reproducibility of computational experiments. Among existing solutions, Docker is the de facto standard in the container industry. In this paper, we advocate the value of applying the Linked Data paradigm to the container ecosystem's building scripts, as it will allow adding additional knowledge, ease decentralized references, and foster interoperability. In particular we de ned a vocabulary Dockeronto that allows to semantically annotate Docker les.</p>
      </abstract>
      <kwd-group>
        <kwd>container</kwd>
        <kwd>Docker</kwd>
        <kwd>Linked Data</kwd>
        <kwd>vocabulary</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Linux Containers 3 (e.g., lxc) are an operating system-level virtualization
technique that revolutionized the way software is packaged and distributed.
Companies exploit lxc to manage complex infrastructures, either internally, e.g., by
means of OpenStack4, or deployed on one of the available cloud solutions, e.g.,
Microsoft Azure5 and Amazon Web Services6. Among the available container
solutions, Docker 7 rapidly became the de facto standard and, more recently,
it started in uencing academic research, because it helps solving a number of
fundamental concerns that address reproducibility and repeatability of
experiments, as put forward by Boettiger [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Docker guarantees (i) modular reuse of
software packages, (ii) a portable environment, (iii) public sharing by means of
web repositories (Docker Registry ), and (iv) versioning.
      </p>
      <p>Docker provides a set of concepts for the creation and initialization of
containers: (i) a Docker Image is a software package containing a single application,</p>
      <sec id="sec-1-1">
        <title>3 https://linuxcontainers.org/</title>
        <p>4 https://www.openstack.org/
5 https://azure.microsoft.com/
6 https://aws.amazon.com/
7 https://www.docker.com/
1 FROM ubuntu : l a t e s t
2 RUN apt get update apt get i n s t a l l y python python pip wget
3 RUN pip i n s t a l l Flask
4 ADD h e l l o . py /home/ h e l l o . py</p>
        <p>Listing 1.1: A Docker le that installs a Python application on Ubuntu.
(ii) a Docker le is the script that contains the instructions used to build the
image, and (iii) a Docker Container is a runable instance of an image.</p>
        <p>The build instructions are at the core of what functionality a container o ers.
Although, this works in the Docker ecosystem, outside this ecosystem these
instructions are not sharable and extendable in a machine-understandable manner.
For example, (i) providing additional information about speci c instructions is
only limited through the use of comments in the script, (ii) refering to speci c
instructions outside of the complete context of its speci c script is not easily
achievable, and (iii) machine-understandibility is limited as the build
instructions are not self-descriptive. Therefore, we advocate the use of Linked Data
principles8 to make these build instructions available. However, to apply these
principles a vocabulary is required to semantically annotate these instructions.</p>
        <p>
          Therefore, in previous e orts, Label-Schema.org9 and Smart Containers [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]
were introduced. However, they do not consider the build instructions.
LabelSchema.org proposes a set of build-time labels for containers in the form of
org.label-schema.[key]=[value] that can be used to add metadata to the
built Docker Image. Smart Containers model Docker concepts using prov-o [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ],
focusing on the environment where computational experiments are executed, but
they remain high level.
        </p>
        <p>
          In this paper, we present Dockeronto10. It is a vocabulary that builds on the
idea of Smart Containers to semantically annotate Docker les. Furthermore, it
uses the Function Ontology (fno) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] to represent a Docker le's instructions.
2
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Dockeronto in a Nutshell</title>
      <p>In this section, we introduce Dockeronto via an example11. The Docker le of
Listing 1.1 installs and runs a Python application on top of the latest available
Ubuntu image and executes the following types of instructions:
1. FROM speci es the base image from which the current Docker le inherits
all the functionalities,
2. RUN executes a command within the image (at build time), and
3. ADD copies a le from the host le systems into the image le system.</p>
      <sec id="sec-2-1">
        <title>8 https://www.w3.org/DesignIssues/LinkedData.html</title>
        <p>9 http://label-schema.org/rc1/
10 https://github.com/riccardotommasini/dockeronto
11 The documentation and more elaborate examples are available at https://github.
com/riccardotommasini/dockeronto.
1 do : from a fno : Function , do : I n s t r u c t i o n ;
2 fno : e x p e c t s ( do : imageInputParam ) ;
3 fno : r e t u r n s ( do : imageOutputParam ) .
4
5 do : run a fno : Function , do : I n s t r u c t i o n ;
6 fno : e x p e c t s ( do : imageInputParam do : runInputCommand ) ;
7 fno : r e t u r n s ( do : imageOutputParam ) .
8
9 do : runInputCommand a fno : Parameter ;
10 fno : p r e d i c a t e do : runCmd ; fno : type do : Command .
11 do : imageInputParam a fno : Parameter ;
12 fno : p r e d i c a t e do : imageInput ; fno : type do : Image .
13 do : imageOutputParam a fno : Output ;
14 fno : p r e d i c a t e do : imageOutput ; fno : type do : Image .</p>
        <p>Listing 1.2: from and run instruction in Dockeronto
ex : d o c k e r f i l e 1 a do : D o c k e r f i l e ;</p>
        <p>do : c o n t a i n s ( ex : i n s 1 ex : i n s 2 ex : i n s 3 ex : i n s 4 ) ;</p>
        <p>Listing 1.3: rdf representation of a Docker le with Dockeronto.</p>
        <p>
          We represent these instructions using the Function Ontology (fno) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ].
Listing 1.2 shows the fno descriptions for FROM and RUN. For example, the RUN
instruction expects an image and a command as input parameters (line 6):
the image is the intermediate image from the previous instruction, and the
command is, e.g., apt-get update &amp;&amp; apt-get install -y python python-pip
wget (Listing 1.1, line 2). Note that the modeling of the individual run commands
is not in scope of this work, as this is not speci c to the Docker le syntax. For
the time being, they are described as string values. The instruction's output is a
new image (line 7), either to be used for the next instruction, or as the resulting
image of the Docker le.
        </p>
        <p>Listing 1.3 shows the Turtle serialization of the example Docker le using
Dockeronto. This representation is queryable yet still executable, because we
use an rdf:List to retain the ordering of the Docker le instructions since it
in uences the output Docker Image. We consider intermediate images, which
are generated during build time, but since they can be inferred we did not
describe them explicitly. Last but not least, we added additional information to
the instructions, such as labels, comments, and their creators.</p>
        <p>Outside the context of this Docker le it is also possible to refer to speci c
instructions without the need to know the complete Docker le or even the fact
ex : r i c c a r d o dbo : c r e a t e d ex : i n s 2 , ex : i n s 4 ;
ex : r e v i e w I n s 3 a schema : Review ;
schema : itemReviewed ex : i n s 3 ;
schema : c o n t r i b u t o r ex : r i c c a r d o .</p>
        <p>Listing 1.4: Knowledge about speci c instructions outside the Docker le context.
that the instructions are related to Docker . For example, in Listing 1.4 additional
knowledge about who created the instructions is provided, together with a review
of one speci c instruction.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>The development of Dockeronto is an important step to improve the use of Docker
build instructions outside the context of a Docker le. This in turn allows to work
towards applying the Linked Data principles. The extensibility and shareability
is improved, and the build instructions are now self-descriptive. As was shown
in the example, (i) additional knowledge can be easily added to the instructions,
(ii) (references to) instructions can be shared outside the context of a Docker le,
and (iii) the use of semantic annotations via Dockeronto allows for self-descriptive
instructions that are understandable even outside of the Docker ecosystem.</p>
      <p>
        For the future, we envision an Linked Container ecosystem, where semantic
technologies are used to empower development work ows, track provenance and
develop semantic microservices [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Belhajjame</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cheney</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corsar</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garijo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Soiland-Reyes</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zednik</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <string-name>
            <surname>PROV-O: The</surname>
            <given-names>PROV</given-names>
          </string-name>
          <string-name>
            <surname>Ontology. Recommendation</surname>
          </string-name>
          ,
          <source>World Wide Web Consortium (W3C) (Apr</source>
          <year>2013</year>
          ), https://www.w3.org/TR/prov-o/, accessed June 14th,
          <year>2017</year>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Boettiger</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>An introduction to docker for reproducible research</article-title>
          .
          <source>Operating Systems Review</source>
          <volume>49</volume>
          (
          <issue>1</issue>
          ),
          <volume>71</volume>
          {
          <fpage>79</fpage>
          (
          <year>2015</year>
          ), http://doi.acm.
          <source>org/10</source>
          .1145/2723872.2723882
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Fernandez-Villamor</surname>
            ,
            <given-names>J.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Iglesias</surname>
            ,
            <given-names>C.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garijo</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Microservices - lightweight service descriptions for REST architectural style</article-title>
          .
          <source>In: ICAART 2010 - Proceedings of the International Conference on Agents and Arti cial Intelligence</source>
          , Volume
          <volume>1</volume>
          - Arti cial Intelligence, Valencia, Spain, January
          <volume>22</volume>
          -
          <issue>24</issue>
          ,
          <year>2010</year>
          . pp.
          <volume>576</volume>
          {
          <issue>579</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Huo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nabrzyski</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vardeman</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Smart container: an ontology towards conceptualizing docker</article-title>
          .
          <source>In: Proceedings of the ISWC 2015 Posters &amp; Demonstrations Track</source>
          , Bethlehem, PA, USA, October
          <volume>11</volume>
          ,
          <year>2015</year>
          . (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Meester</surname>
            ,
            <given-names>B.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dimou</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mannens</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>An ontology to semantically declare and describe functions</article-title>
          .
          <source>In: The Semantic Web - ESWC 2016 Satellite Events</source>
          , Heraklion, Crete, Greece, May 29 - June 2,
          <year>2016</year>
          , Revised Selected Papers. pp.
          <volume>46</volume>
          {
          <issue>49</issue>
          (
          <year>2016</year>
          ), https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -47602-5_
          <fpage>10</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>