Comments (3)
Seeing this too...
from boot2docker-vagrant-box.
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 :
- http://www.centurylinklabs.com/optimizing-docker-images/?hvid=2b3AmY
- http://tuhrig.de/flatten-a-docker-container-or-image/
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.
@dduportal
solution 1 is ok!
thank you very much.
this issue i will be closed.
from boot2docker-vagrant-box.
Related Issues (20)
- Can boot2docker actually be used with this box? HOT 2
- Cannot run with VMWare Fusion 5
- Parallels not working?
- How to upgrade? HOT 4
- Unable to boot on vmware, goes straight to PXE HOT 11
- new release HOT 5
- Forward container ports to the host HOT 2
- New release for Docker 1.0 ? HOT 7
- Redirect new docker port 2375 HOT 2
- NFS shared folder mounting hangs HOT 5
- Move to boot2docker 1.3 HOT 8
- How can I use docker command in the OSX terminal? HOT 2
- Can't create directory (Windows 7)
- Update to 1.3.1 HOT 7
- Version bump to 1.3.0 HOT 1
- vagrant up asks for docker password HOT 31
- Insufficient graphic memory for boot2docker Vbox VM when using docker provider with force_host_vm
- Could not reach any registry endpoint HOT 7
- Error creating VM: VBoxManage error: VBoxManage.exe: error: Guest OS type 'windows10' is invalid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boot2docker-vagrant-box.