Skip to content

Instantly share code, notes, and snippets.

@codinnvrends
Created January 27, 2020 08:55
Show Gist options
  • Select an option

  • Save codinnvrends/eb193b463dc508608f9dbe1e96f21743 to your computer and use it in GitHub Desktop.

Select an option

Save codinnvrends/eb193b463dc508608f9dbe1e96f21743 to your computer and use it in GitHub Desktop.
1. Copy your local python folder/package to directory containing Dockerfile e.g.
../mydocker
- Dockerfile
- <mylocalpythonpackage>
- config.propertis
- ..
2. Modify your Dockerfile to add local python package to docker image as :
ADD /<your local python package/dir.> /<same_package_name_as_local> e.g. ADD /test /test
2. Not mandatory but if needed you can opt for installing major dependencies :
RUN pip install <your dependencies>
3. Now install local package
RUN pip install ../<your local python package/dir.>/
NOTE the '..' in above command, as you pkg has been placed outside current working directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment