Simple Dockerfile - can't deploy. `pip install` throws out "no such file or directory"

I’m trying to push the code at to my balena app.

It worked while my Raspi was in local dev mode. Now, whether I type git push balena master or balena push <app name> --convert-eol I just get this error:

standard_init_linux.go:207: exec user process caused “no such file or directory”

Then “The command ‘/bin/sh -c pip install pyserial’ returned a non-zero code: 1” and eventually “Not deploying release.”

My Dockerfile is at -

FROM balenalib/raspberrypi3-alpine-python:3.8-latest-build
RUN pip install pyserial
CMD python

What am I missing?

I used a requirements.txt Instead of explicitly calling install package and hat seems to work for me.

Hi Richard, it looks like there may be an issue with the latest build of the image you’re trying to use. Could you try using FROM balenalib/raspberrypi3-alpine-python:3.8-latest-build-20200405 and seeing if that helps? Thanks.

@wrboyce that fixes it. So is that a balena platform thing, not something I could’ve known in advance?

Hello @mozz100,
It looks like the balenalib/raspberrypi3-alpine-python:3.8-latest-build base image hasn’t been built with the latest updates yet. Thanks for the feedback.

So is that a balena platform thing, not something I could’ve known in advance?

In general, as a best practice we recommend using frozen images to avoid unexpected behaviour from updates. You can take a look at the docs here

Thank you! Much appreciated - balena support is awesome, in my experience you always solve whatever it is!

I’ll use frozen images now that I know - hadn’t come across that documentation because I’m soooo far from production or fleet management in my project! I do see “non-frozen” images used in lots of the getting started examples - might be worth mentioning for other people taking early steps.

Although, it sounds like this was a temporary/rare blip in the python image - if I’m understanding correctly, the main reason for using frozen images is avoiding downloading newer versions of things unnecessarily/unexpectedly, rather than breakiness :slight_smile: - I just got a bit unlucky. Frozen images for me from now on!

Hi @mozz100

Thank you for your kind words, glad we could help!

Kind regards