Giter Site home page Giter Site logo

Comments (3)

gangster avatar gangster commented on September 23, 2024

Seeing this too...

from boot2docker-vagrant-box.

dduportal avatar dduportal commented on September 23, 2024

Hi !

It seems related to the AUFS backend of Docker itself : moby/moby#5135.
There is a known limit of 127 layers when using this storage backend. I think that your custom ubuntu image have a lot of layers.

Solution 1 : flatten your build

It can be a quick-win solution in your case.
Reading @yangtao309 Dockerfile, i see some things to change :

  • When using apt-get, put updates and install on the same line or you'll run in trouble (If apt-get update layer is cached with the version 1.0 of your package, the install will fail when 2.0 will be available as default). Anyway, you'll push the AUFS-127's limit
RUN apt-get update && apt-get install -y software-properties-common
  • I see what you're doing with different sections (one for java, one for maven, etc.), but using Docker cache should be considered when developing you image. One time the image has been built, the loop of changes won't be often : you should group you action (apt-get install all packages in one layer, run all shell script action on only one RUN)
RUN apt-get update && apt-get install -y software-properties-common maven opens-server ...
  • WORKDIR is a cool instruction when working with some wget/tar but it creates unused layers (it stole some precious layers when running around 127 and it weight a lot !). You should use it only one time at the end.
# install karaf
RUN cd /home/runner \
    && wget -q http://repo2.maven.org/maven2/org/apache/karaf/apache-karaf/2.3.4/apache-karaf-2.3.4.tar.gz \
    && tar xzvf apache-karaf-2.3.4.tar.gz \
    && mv apache-karaf-2.3.4 apache-karaf \
    && rm -f apache-karaf-2.3.4.tar.gz

A little bit of reading around that :

Solution 2 : switch Docker's storage backend

How to switch backend and use devicemapper instead of AUFS (or any other existing) ?
In boot2docker, you just have to :

  • Set a var in a Shell file :
    In /var/lib/boot2docker/profile (create it if not existing), add this line
DOCKER_STORAGE=devicemapper
  • Restart docker :
sudo /etc/init.d/docker restart

It will be persisted across reboots. Note you'll have to rebuild all (cache is not shareable between AUFS and others backends).

A little bit of (quick) reading around these storage backends : http://www.projectatomic.io/docs/filesystems/

Good luck !

from boot2docker-vagrant-box.

yangtao309 avatar yangtao309 commented on September 23, 2024

@dduportal
solution 1 is ok!
thank you very much.
this issue i will be closed.

from boot2docker-vagrant-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.