user2349115
user2349115

Reputation: 1286

/bin/sh: 1: python: not found while running docker container

This is my docker file

FROM ubuntu:14.04 
ADD ./file.py ./
CMD python file.py

I am building using below command:

docker build -t myimage .

And running using this:

docker run myimage

And then getting below error after running:

/bin/sh: 1: python: not found

What should I do so the file file.py will be executed using python ?

Upvotes: 2

Views: 6301

Answers (1)

skovorodkin
skovorodkin

Reputation: 10264

Use the official python Docker image:

FROM python:3.6
COPY ./file.py ./
CMD python file.py

Upvotes: 3

Related Questions