Using dockerbuild file, how can I do there something like:
export PYTHONPATH=/:$PYTHONPATH
using RUN directive or other option
In your Dockerfile, either of these should work:

Use the ENV instruction (ENV PYTHONPATH="/:$PYTHONPATH")
Use a prefix during the RUN instruction (RUN export PYTHONPATH=/:$PYTHONPATH && <do something>)

The former will persist the changes across layers. The latter will take effect in that layer/RUN command
Adding path to pythonpath in dockerbuild file