Docker Madlib Postgres

377 views Asked by At

I was trying to install Apache MADLib on Postgres. Having difficulty with YUM approach I moved to Docker approach as suggested by this website https://pgxn.org/dist/madlib/

I was able to pull docker image as suggested at para 1. Now at para 2 I am stuck with comment "Path to incubator-madlib directory". I am not able to understand whether it should be the URL to MADLib Incubator such as "https://github.com/apache/incubator-madlib" or it should refer to local disk area. It would be great by giving an example of how to run this command.

2) Launch a container corresponding to the MADlib image, mounting the source code folder to the container:

docker run -d -it --name madlib \ -v (path to incubator-madlib directory):/incubator-madlib/ madlib/postgres_9.6 
2

There are 2 answers

1
Robert On

As is documented, that is the directory on your computer where the source code resides:

where incubator-madlib is the directory where the MADlib source code resides.

So, supossing that you have downloaded the source code in ./incubator-madlib, run as this:

docker run -d -it --name madlib -v $(pwd)/incubator-madlib:/incubator-madlib/ madlib/postgres_9.6 

Then see what the container logs:

docker logs -f madlib
0
Nandish Jayaram On

The (path to incubator-madlib directory) refers to wherever you have git cloned the MADlib code base to on your machine. Say for example, your home directory in your machine is /home/xyz/ and you have cloned the MADlib code base there, you should have a directory called /home/xyz/incubator-madlib. You can now run the docker command documented in the MADlib repo as follows:

docker run -d -it --name madlib -v /home/xyz/incubator-madlib/:/incubator-madlib/ madlib/postgres_9.6

You were probably getting the Permission denied docker:... error after trying Robert's suggestion because the $(pwd) was not referring to your incubator-madlib source code folder, but was referring to /var/lib/docker/devicemapper/devicemapper/data, which should not be the case. In any case, it might be a better idea to provide the incubator-madlib directory's absolute path in the docker command, as specified above.