Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose fails at PyYAML==6.0 #18

Open
aebgit opened this issue Jan 13, 2024 · 2 comments
Open

docker-compose fails at PyYAML==6.0 #18

aebgit opened this issue Jan 13, 2024 · 2 comments

Comments

@aebgit
Copy link

aebgit commented Jan 13, 2024

When installing i noticed two issues:

  1. docker compose build throws docker: 'compose' is not a docker command., so I assume you meant docker-compose build instead
  2. when running docker-compose build from inside ~/homeassistant-bluetooth-mesh/docker, this fails with the error below:
Collecting PyYAML==6.0
#0 76.92   Downloading PyYAML-6.0.tar.gz (124 kB)
#0 76.96      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.0/125.0 kB 3.3 MB/s eta 0:00:00
#0 77.43   Installing build dependencies: started
#0 86.08   Installing build dependencies: finished with status 'done'
#0 86.08   Getting requirements to build wheel: started
#0 86.81   Getting requirements to build wheel: finished with status 'error'
#0 86.84   error: subprocess-exited-with-error
#0 86.84   
#0 86.84   × Getting requirements to build wheel did not run successfully.

I googled around and this seems to be a known problem with PyYAML==6.0. However I couldn't solve it by redirecting to another version, because it seems docker-compose uses the requirements.txt from your Github-repo and not my local file.

Looking forward for any advice!

BR
Andreas

@dominikberse
Copy link
Owner

Hello Andreas,

thanks for the feedback. Regarding your first point, compose is being integrated into docker as a CLI plugin and therefore the command changed from docker-compose to docker compose (see for example https://stackoverflow.com/a/66516826/12661819).

I am not sure about the problem with PyYaML. I currently do not have the time to look into it, but I guess you can change the Dockerfile to copy the local files instead of cloning the repo (now that I see that, its weird that I did that in the first place).

Due to the current directory structure, I guess you have to add the context: prop under build: in docker-compose.yaml, so it would look something like this

   ...
    build:
      context: ../
      dockerfile: ./docker/Dockerfile
   ...

and then change all local paths in the Dockerfile accordingly. Then you should be able to change

RUN git clone https://github.com/dominikberse/homeassistant-bluetooth-mesh.git .
RUN git checkout master

to

COPY . .

which will copy your local files instead of cloning the repo.

You will probably have to adjust some of this, I just wrote it down here without further tests. But it's a good starting point hopefully.

Good luck,
Dominik

@rogierg
Copy link

rogierg commented Jun 26, 2024

Hi there, I fixed this by changing the pip install line in the Dockerfile:

RUN pip3 install --upgrade pip && pip3 install "cython<3.0.0" wheel && pip install "pyyaml==6.0" --no-build-isolation && pip3 install -r requirements.txt

Then remove cython from the requirements.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants