Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. FROM python:3.7 as buildimage
  2. RUN useradd -u 1000 -ms /bin/bash python
  3. WORKDIR /home/python
  4. USER python
  5. RUN python -m venv /home/python/venv
  6. # "Activate" the venv
  7. ENV PATH="/home/python/venv/bin:$PATH"
  8. COPY req.txt req.txt
  9. RUN pip install -r req.txt
  10. # COPY jam.h jam.h
  11. # COPY jamlib.a jamlib.a
  12. # COPY jamlib_build.py jamlib_build.py
  13. # RUN python jamlib_build.py
  14. RUN pip wheel --wheel-dir=/home/python/wheels -r req.txt
  15. RUN find .
  16. RUN ls -la
  17. RUN pip freeze
  18. FROM python:3.7-slim
  19. RUN useradd -u 1000 -ms /bin/bash python && \
  20. apt update && \
  21. apt install -y libgd3
  22. WORKDIR /home/python
  23. USER python
  24. RUN python -m venv /home/python/venv
  25. # "Activate" the venv
  26. ENV PATH="/home/python/venv/bin:$PATH"
  27. COPY --from=buildimage /home/python/wheels /home/python/wheels
  28. COPY req.txt req.txt
  29. RUN pip install --no-index --find-links=/home/python/wheels -r req.txt
  30. COPY --from=buildimage /home/python/_pi_cffi.* /home/python/
  31. # COPY --from=buildimage /home/python/venv/lib/python3.7/site-packages/.libs_cffi_backend /home/python/venv/lib/python3.7/site-packages/
  32. # CMD ["python", "tcp-proxy.py"]