github.com/shivanshs9/go-overlay2@v0.0.0-20160814221707-8877415a0206/doc.go (about)

     1  // Copyright 2016 Dennis Chen <barracks510@gmail.com>
     2  // Copyright 2013-2016 Docker, Inc.
     3  //
     4  // Licensed under the Apache License, Version 2.0 (the "License");
     5  // you may not use this file except in compliance with the License.
     6  // You may obtain a copy of the License at
     7  //
     8  //     http://www.apache.org/licenses/LICENSE-2.0
     9  //
    10  // Unless required by applicable law or agreed to in writing, software
    11  // distributed under the License is distributed on an "AS IS" BASIS,
    12  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  // See the License for the specific language governing permissions and
    14  // limitations under the License.
    15  
    16  // This backend uses the overlay union filesystem for containers
    17  // with diff directories for each layer.
    18  //
    19  // This version of the overlay driver requires at least kernel
    20  // 4.0.0 in order to support mounting multiple diff directories.
    21  //
    22  // Each container/image has at least a "diff" directory and "link" file.
    23  // If there is also a "lower" file when there are diff layers
    24  // below  as well as "merged" and "work" directories. The "diff" directory
    25  // has the upper layer of the overlay and is used to capture any
    26  // changes to the layer. The "lower" file contains all the lower layer
    27  // mounts separated by ":" and ordered from uppermost to lowermost
    28  // layers. The overlay itself is mounted in the "merged" directory,
    29  // and the "work" dir is needed for overlay to work.
    30  //
    31  // The "link" file for each layer contains a unique string for the layer.
    32  // Under the "l" directory at the root there will be a symbolic link
    33  // with that unique string pointing the "diff" directory for the layer.
    34  // The symbolic links are used to reference lower layers in the "lower"
    35  // file and on mount. The links are used to shorten the total length
    36  // of a layer reference without requiring changes to the layer identifier
    37  // or root directory. Mounts are always done relative to root and
    38  // referencing the symbolic links in order to ensure the number of
    39  // lower directories can fit in a single page for making the mount
    40  // syscall. A hard upper limit of 128 lower layers is enforced to ensure
    41  // that mounts do not fail due to length.
    42  package overlay2