Search code examples
pythondockervirtual-machinegoogle-cloud-platformboot2docker

Add 3rd party library to Google Cloud Virtual Machine


I want to setup a Virtual Machine on Google Cloud Platform and use a third party library. I've followed the instruction here to set everything up in python, but I'm not sure how to proceed. I would like to add this library. What would be the right way to do this?


Solution

  • After some troubleshooting this was the solution that worked:

    Dockerfile

    FROM gcr.io/google_appengine/python-compat
    
    RUN apt-get update && apt-get install -y curl gcc python-dev g++ libxml2-dev libxslt1-dev
    ADD requirements.txt /app/
    RUN pip install -r requirements.txt
    
    ADD . /app
    

    requirements.txt

    talon==1.0.2