Error start docker container

Hello. I have made next to a mistake during start container. I want to pack Django project using UV. Build container is OK.

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "make": executable file not found in $PATH: unknown

My file Dockerfile

FROM python:3.12-slim-bookworm

# The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates

# Download the latest installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh

# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh

# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.local/bin/:$PATH"

RUN mkdir /app

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1


COPY requirements.txt . /app/

COPY . /app/

EXPOSE 8000

CMD ["uv", "run", "gunicorn", "python", "manage.py", "runserver", "0.0.0.0:8000"] 

My docker-compose.yml

version: "3.9"

services:

  app:
    build:
      context: .
      dockerfile: Dockerfile.production
    image: nic11371/task_manager
    environment:
      DATABASE_USERNAME: ${DATABASE_USERNAME}
      DATABASE_PASSWORD: ${DATABASE_PASSWORD}
      DATABASE_NAME: ${DATABASE_NAME}
      DATABASE_HOST: ${DATABASE_HOST}
    command: make test
    depends_on: 
      - db

  db:
    image: postgres
    environment:
      POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
      POSTGRES_USER: ${DATABASE_USERNAME}
    ports:
     - "5432:5432"
    volumes:
     - postgres_data:/var/lib/postgresql/data
    env_file:
     - .env
volumes:
   postgres_data:

I’m not sure I understand the quesiton, but based on the shared code, you just need to install make in the image, but you only install curl and ca-certificates.

This is helped me. But I have still a problem.
command docker compose up after docker compose build
error

db-1   | 2025-04-17 19:13:32.142 UTC [29] LOG:  database system was shut down at 2025-04-17 19:12:37 UTC
db-1   | 2025-04-17 19:13:32.150 UTC [1] LOG:  database system is ready to accept connections
app-1  | python manage.py test
app-1  | Traceback (most recent call last):
app-1  |   File "/task_manager/manage.py", line 11, in main
app-1  |     from django.core.management import execute_from_command_line
app-1  | ModuleNotFoundError: No module named 'django'
app-1  | 
app-1  | The above exception was the direct cause of the following exception:
app-1  | 
app-1  | Traceback (most recent call last):
app-1  |   File "/task_manager/manage.py", line 22, in <module>
app-1  |     main()
app-1  |   File "/task_manager/manage.py", line 13, in main
app-1  |     raise ImportError(
app-1  | ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
app-1  | make: *** [Makefile:44: tests] Error 1

I can’t understand why don’t setup all these depences ? I have requirements.txt, why don’t setup depencies ?
How do fix problem?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.