Elnura Zhalieva
Elnura Zhalieva

Reputation: 11

"error readlink /var/lib/docker/overlay2 invalid argument" when I run docker-compose up

I'm trying to dockerize project written in django and postgresql. What I've already done: I have environment variables stores in env_file:

SECRET_KEY=value
DEBUG=value
ALLOWED_HOSTS=['192.168.99.100']
DB_NAME=postgres
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=db
DB_PORT=5432

My Dockerfile:

FROM python:3.7-stretch

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY requirements.txt /code/

WORKDIR /code/

RUN pip install -r requirements.txt

COPY . /code/

My docker-compose.yml file:

version: '3'

services:
  db:
    image: postgres:11-alpine
    restart: always
    volumes: 
      - postgres_data:/var/lib/postgresql/data/
    environment:
      POSTGRES_PASSWORD: postgres
    container_name: "my_postgres"
    ports:
      - "5432:5432"
  web:
    build: .
    command: python /code/cameo/manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code/
    env_file:
      - env_file
    ports:
      - "8000:8000"
    depends_on:
      - db
volumes:
  postgres_data:

Please help, I don't know what I'm doing wrong.

Upvotes: 1

Views: 3966

Answers (1)

Daniel
Daniel

Reputation: 887

If you are running Docker on Windows, some files may have been corrupted. The following command worked for me : "docker-compose down --rmi all"

Upvotes: 2

Related Questions