The dockerfile has not changed, but the file outside the container corresponding to workdir has changed.
-
Is this necessary? If so, is it to use Docker Compose-Up to automatically simplify the process?
-
If not, is it because of my dockerfile problem?
Dockerfile is as follows:FROM ubuntu MAINTAINER Tarty.Phoenix <tartyphoenix@gmail.com > RUN apt-get update RUN apt-get install -y -q python-all python-pip libffi-dev RUN apt-get install -y -q python-dev build-essential ADD ./flask_pure/requirements.txt /tmp/requirements.txt RUN pip install -qr /tmp/requirements.txt ADD ./flask_pure /opt/flask_pure/ WORKDIR /opt/flask_pure EXPOSE 80 CMD ["python", "manage.py", "runserver"]
First of all, the directory represented by workdir is the directory inside the container, not host’s.
The following changes need to be build image
Dockerfile itself changes
Source file change for COPY/ADD instruction
Docker-compose supports rebuilding Image at runtime
service: - build: <image_base_dir>