LMSouq
server-admin Open

Docker image error: "/bin/sh: 1: [python,: not found"

JO
Joe Mornin
1 month ago
3 views
Problem Description
I'm building a new Docker image based on the standard Ubuntu 14.04 image. Here's my *Dockerfile*: FROM ubuntu:14.04 RUN apt-get update -y RUN apt-get install -y nginx git python-setuptools python-dev RUN easy_install pip ADD . /code WORKDIR /code RUN pip install -r requirements.txt # only 'django' for now ENV projectname myproject EXPOSE 80 8000 WORKDIR ${projectname} CMD ['python', 'manage.py', 'runserver', '0.0.0.0:80'] When I try to run this image, I get this error... > /bin/sh: 1: [python,: not found But if I open a shell when running the image, running `python` opens the interactive prompt as expected. Why can't I invoke `python` through `CMD` in the Dockerfile?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base