Inizialmente ho installato il docker 1.5 installato in ubuntu Trusty
via Vagrant.
Quindi ho creato un nuovo Ubuntu Trusty
e adesso la versione docker è 1.7
.
Ho provato a build l'image del mio contenitore Postgres con questo Dockerfile
FROM ubuntu:trusty RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" > /etc/apt/sources.list RUN apt-get -y update RUN apt-get -y install wget openssh-server RUN apt-get install -y supervisor RUN mkdir -p /var/run/sshd RUN wget --quiet --no-check-certificate -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list RUN apt-get -y update RUN apt-get -y upgrade RUN locale-gen --no-purge en_US.UTF-8 ENV LC_ALL en_US.UTF-8 RUN update-locale LANG=en_US.UTF-8 RUN apt-get -y install postgresql-9.3 postgresql-contrib-9.3 postgresql-9.3-postgis-2.1 postgis RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf RUN service postgresql start && /bin/su postgres -c "createuser -d -s -r -l docker" && /bin/su postgres -c "psql postgres -c \"ALTER USER docker WITH PASSWORD 'docker'\"" && service postgresql stop RUN echo "listen_addresses = '*'" >> /etc/postgresql/9.3/main/postgresql.conf RUN echo "port = 5432" >> /etc/postgresql/9.3/main/postgresql.conf EXPOSE 5432 22 ADD start.sh /start.sh RUN chmod 0755 /start.sh cmd ["supervisord", "-n"]
Ora quando controlla il mio ubuntu con il docker 1.5 the
Filesystem Size Used Avail Use% Mounted on /dev/sda1 40G 2.3G 36G 6% / none 4.0K 0 4.0K 0% /sys/fs/cgroup
Quando controllii il docker 1.7 allora
Filesystem Size Used Avail Use% Mounted on /dev/sda1 40G 14G 24G 38% / none 4.0K 0 4.0K 0% /sys/fs/cgroup
Ho testato specificamente con un'unica image e niente altro sul server.
Ho anche controllato l'utilizzo del disco e la sua provenienza da /var/lib/docker/vfs/dir
Voglio sapere cosa è cambiato in 1.7 che sta causando questo
È un problema noto
estratto da https://forums.docker.com/t/docker-1-7-0-is-using-huge-amount-of-disk-space/2046/2
"La ragione sembra mancare delle impostazioni aufs sullo script di installazione https://get.docker.com/ubuntu/ "
la correzione è
"Funziona bene quando il docker installato con lo script https://get.docker.com ".