So I am pretty new to docker and django. Unfortunately while running the below command on my linux machine which i am connected using my physical windows machine using putty:
I am getting an error:
Error processing tar file(exit status 1): open /myenv/include/python3.6m/Python-ast.h: no such file or directory
‘myenv’ is the environment I have created inside my folder.
I am getting a container started on port 9000. The app doesn’t have anything yet just a simple project so i just expect to see the ‘congratulations’ screen. I don’t know where I am going wrong. My final goal would be to run the docker url in my windows browser and see the screen of docker container.
This is my docker-compose.yml file:
version: '3' services: web: build: . command: python manage.py runserver 0.0.0.0:9000 ports: - 22.214.171.124:8000:9000
126.96.36.199 is my public IP. I did the above binding so as to access the docker container from my windows machine. Would request additional inputs for the port binding as well if correct/incorrect.
Below is my Dockerfile:
FROM python:3.6.9 RUN mkdir djangotest WORKDIR djangotest ADD . /djangotest RUN pip install -r requirements.txt
Please help me out peeps!
If you have a virtual environment in your normal development tree, you can’t copy it into a Docker image. You can exclude this from the build sequence by mentioning it in a
# .dockerignore myenv
Within the Dockerfile, the
RUN pip install line will install your application’s dependencies into the Docker image, so you should have a complete self-contained image.
Answered By – David Maze