V
V
Vova Putsyk2018-08-20 00:36:32
Django
Vova Putsyk, 2018-08-20 00:36:32

How not to rebuild a docker image every time a file changes?

I just started to deal with docker and I have such a question - the situation is this: I have a project in which I and 1 other person participate, it does not understand Django and I want to make a Docker image that would run the runserver command. I would like to run the container without rebuilding the image on every file change. As far as I understand, access to files outside the docker is possible through volume and tried to specify it in the Dockerfile ( VOLUME .), but with this line I constantly get an error:

ERROR: for django  Cannot start service django: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"apparmor failed to apply profile: open /proc/self/attr/exec: no such file or directory\"": unknown
ERROR: Encountered errors while bringing up the project.

My Dockerfile is now:
FROM ubuntu:16.04

RUN apt-get -yqq update
RUN apt-get -yqq upgrade
RUN apt-get -yqq install python3.5 python3-pip python3-dev

ADD . /opt/app
WORKDIR /opt/app

RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt

EXPOSE 8000

CMD ["python3", "./manage.py", "runserver", "0.0.0.0:8000"]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-08-20
@vovawed

volume is written when the container is started:
-v /local/path:/docker/path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question