Unable to migrate Django db when using docker container

On my Windows 10 machine, I am developing a database manager. Because the backend uses LDAP and the required development libraries are only available for Linux, I want to use Docker to set up an environment with the appropriate libs.

I managed to write a Dockerfile and compose file, that launch the (currently very basic) Django app in a Docker container with all the libs necessary.
I would like to play around with the django-ldapdb package and for that I want to apply the migrations.

  • can we update docker default configure?
  • Stopping docker container from inside
  • Can't connect to MySQL docker container created via docker-compose
  • Docker services in image not launching
  • “docker run hello-world” through a proxy tunnel
  • Undertsanding docker build
  • When I open PyCharm’s terminal and try to execute python manage.py migrate, I get an error telling me that the module ldapdb is not found. I suspect this is because the command does not use the remote Docker interpreter I set up with PyCharm.
    The other thing I tried is using PyCharm’s dedicated manage.py console. This does not initialize properly. It says the working directory is invalid and needs to be an absolute path, although the path it shows it the absolute path to the project.

    I have to admit that I have no idea how this remote interpreter works and I don’t see any Docker container running, so I might have not understood something properly here. I even tried running the app using PyCharm’s Django run config, which started a container, but still I get the same errors.

    I googled a lot, but I couldn’t find more infos about remote interpreters nor something solving my issue.

  • Unable to mount a folder on C Drive as Volume
  • RabbitMQ inside docker won't end gracefully and cannot reconnect
  • Unable to connect instances of docker-machine to pull docker images running behind a corporate proxy
  • DC/OS and concurrent deployments
  • Docker doesn't resolve hostname
  • Understanding how to import a map.osm file into a postgres database.
  • One Solution collect form web for “Unable to migrate Django db when using docker container”

    The only way I managed to do this, is by executing the command inside the container.

    To get inside a container named contr, use the docker command

    docker exec -ti contr /bin/bash
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.