AnotherDaniel / smahub

SMAHub is a flexible and modular solution for collecting data from SMA photovoltaic (PV) products and publishing it to various output channels, such as MQTT.
GNU General Public License v2.0
31 stars 11 forks source link

Dockerfile doesn't work anymore #19

Closed Christoph-87 closed 11 months ago

Christoph-87 commented 11 months ago

I have an automatic build setup for this repository. It builds a container daily. Since 08.12.2023 this build fails and a message is shown that the Dockerfile needs to be amended.

Would it be possible to change the Dockerfile accordingly? It shows the error after "RUN pip3 install .".

22:30:19 Step 6/10 : RUN pip3 install .
22:30:19 
22:30:19 
22:30:19  ---> Running in d0fc155390e4
22:30:19 
22:30:26 error: externally-managed-environment
22:30:26 
22:30:26 × This environment is externally managed
22:30:26 ╰─> 
22:30:26     The system-wide python installation should be maintained using the system
22:30:26     package manager (apk) only.
22:30:26     
22:30:26     If the package in question is not packaged already (and hence installable via
22:30:26     "apk add py3-somepackage"), please consider installing it inside a virtual
22:30:26     environment, e.g.:
22:30:26     
22:30:26     python3 -m venv /path/to/venv
22:30:26     . /path/to/venv/bin/activate
22:30:26     pip install mypackage
22:30:26     
22:30:26     To exit the virtual environment, run:
22:30:26     
22:30:26     deactivate
22:30:26     
22:30:26     The virtual environment is not deleted, and can be re-entered by re-sourcing
22:30:26     the activate file.
22:30:26     
22:30:26     To automatically manage virtual environments, consider using pipx (from the
22:30:26     pipx package).
22:30:26 
22:30:26 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
22:30:26 hint: See PEP 668 for the detailed specification.
22:30:26 
22:30:28 ERROR: Build step failed with exception
22:30:28 com.github.dockerjava.api.exception.DockerClientException: Could not build image: The command '/bin/sh -c pip3 install .' returned a non-zero code: 1
22:30:28    at com.github.dockerjava.api.command.BuildImageResultCallback.getImageId(BuildImageResultCallback.java:78)
22:30:28    at com.github.dockerjava.api.command.BuildImageResultCallback.awaitImageId(BuildImageResultCallback.java:50)
22:30:28    at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$Run.buildImage(DockerBuilderPublisher.java:425)
22:30:28    at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$Run.run(DockerBuilderPublisher.java:359)
22:30:28    at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.perform(DockerBuilderPublisher.java:520)
22:30:28    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
22:30:28    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
22:30:28    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
22:30:28    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
22:30:28    at hudson.model.Build$BuildExecution.build(Build.java:199)
22:30:28    at hudson.model.Build$BuildExecution.doRun(Build.java:164)
22:30:28    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
22:30:28    at hudson.model.Run.execute(Run.java:1895)
22:30:28    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
22:30:28    at hudson.model.ResourceController.execute(ResourceController.java:101)
22:30:28    at hudson.model.Executor.run(Executor.java:442)
22:30:28 Build step 'Build / Publish Docker Image' marked build as failure
AnotherDaniel commented 11 months ago

Hi @Christoph-87 , thank you for reporting this! I will look into the issue asap, give me a couple of days.

AnotherDaniel commented 11 months ago

Alright - I've just merged a "fix" around this new Alpine feature, looking good but please let me know if this works for you.

Christoph-87 commented 11 months ago

Hi, sorry I couldn't look earlier in this. It works for me. Thanks a lot!