JavaSa
JavaSa

Reputation: 6241

Adding path to pythonpath in dockerbuild file

Using dockerbuild file, how can I do there something like:
export PYTHONPATH=/:$PYTHONPATH

using RUN directive or other option

Upvotes: 2

Views: 3793

Answers (1)

Jay Dorsey
Jay Dorsey

Reputation: 3662

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

Upvotes: 7

Related Questions