Skip to content

Building docker containerΒ #76

@urgor

Description

@urgor

Hi. I'm trying to build docker container with this app. I've created this Dockerfile (RUNs on each line is just for visibility) :

FROM python:3

RUN apt update
RUN apt install -y apt-utils git pipenv python3-pip-whl python3-setuptools-whl python3-wheel-whl python3-venv

RUN adduser appuser
USER appuser
WORKDIR /home/appuser
ENV PATH="/home/appuser/.local/bin:${PATH}"

RUN python -m pip install --upgrade pip setuptools
RUN pip3 install wheel
RUN python -m ensurepip --upgrade

RUN git clone https://github.com/philippnormann/chia-monitor.git /home/appuser/app
WORKDIR /home/appuser/app
RUN pipenv --python 3 install
RUN pipenv --python 3 run alembic upgrade head

ENTRYPOINT [ "pipenv" ]
CMD ["run", "python3", "-m", "monitor"]

And making docker build . I get

---> 46cda56ee17a
Step 14/17 : RUN pipenv --python 3 install
 ---> Running in 4a21afcc4ad8
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Creating a virtualenv for this project...
Pipfile: /home/appuser/app/Pipfile
Using /usr/local/bin/python3 (3.13.2) to create virtualenv...
fail
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 82, in _get
    result = get_wheel(
             ^^^^^^^^^^
....
  File "/usr/lib/python3/dist-packages/virtualenv/seed/wheels/embed/__init__.py", line 76, in get_embed_wheel
    raise Exception((
Exception: Wheel for pip for Python 3.13 is unavailable. apt install python3-pip-whl
fail
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 82, in _get
    result = get_wheel(
             ^^^^^^^^^^
....
 File "/usr/lib/python3/dist-packages/virtualenv/seed/wheels/embed/__init__.py", line 76, in get_embed_wheel
    raise Exception((
Exception: Wheel for setuptools for Python 3.13 is unavailable. apt install python3-setuptools-whl
fail
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 82, in _get
    result = get_wheel(

However if I use python:3.9 images building process finishes with:

Step 11/14 : RUN pipenv install
 ---> Running in 47096f6c34d2
Creating a virtualenv for this project...
Pipfile: /home/appuser/app/Pipfile
Using /usr/bin/python3 (3.11.2) to create virtualenv...
created virtual environment CPython3.11.2.final.0-64 in 220ms
  creator CPython3Posix(dest=/home/appuser/.local/share/virtualenvs/app-yGWyvGGG, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/appuser/.local/share/virtualenv)
    added seed packages: pip==23.0.1, setuptools==66.1.1, wheel==0.38.4
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

βœ” Successfully created virtual environment!
Virtualenv location: /home/appuser/.local/share/virtualenvs/app-yGWyvGGG
Installing dependencies from Pipfile.lock (6752a6)...
An error occurred while installing aiohttp==3.7.4 --hash=sha256:bc3d14bf71a3fb94e5acf5bbf67331ab335467129af6416a437bd6024e4f743d --hash=sha256:5d84ecc73141d0a0d61ece0742bb7ff5751b0657dab8405f899d3ceb104cc7de 
....

I'm not familiar with python and python environments, could you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions