macospostgresqldockermacos-sierrapostgresql-9.5

Docker FATAL: could not write lock file "postmaster.pid": No space left on device


postgres:9.5

I try rebooting,

docker-compose build --no-cache

delete image and container and build again

I have many proyects and anybody starts, keeps the same configuration... Mac osx Sierra

docker version

see the error


Apparently the containers were not deleted well, I tried with this and after rebuild works ok.

# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)

docker-compose.yml

version: '2'
services:
  web:
    build: .
    image: imagename
    command: python manage.py runserver 0.0.0.0:8000
    ports:
      - "3000:3000"
      - "8000:8000"
    volumes:
      - .:/code
    depends_on:
      - migration
      - redis
      - db
  redis:
    image: redis:3.2.3
  db:
    image: postgres:9.5
    volumes:
      - .:/tmp/data/
  npm:
    image: imagename
    command: npm install
    volumes:
      - .:/code
  migration:
    image: imagename
    command: python manage.py migrate --noinput
    volumes:
      - .:/code
    depends_on:
      - db

Dockerfile:

FROM python:3.5.2
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/

RUN mkdir /code
WORKDIR /code

RUN easy_install -U pip

ADD requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt`

Solution

  • If you do not have any critical data you can blow away the docker volume.

    docker volume ls

    docker volume rm your_volume