carpentries-incubator / docker-introduction

Reproducible Computational Environments using Containers
https://carpentries-incubator.github.io/docker-introduction/
Other
42 stars 48 forks source link

sum.py needs to invoke python3 not python #164

Closed colinsauze closed 2 years ago

colinsauze commented 2 years ago

In the "Creating More Complex Container Images" episode in the final part of the "More fancy Dockerfile options" section (Add the sum.py script to the PATH so you can run it directly), sum.py cannot run as it begins with:

!/usr/bin/env python

and alpine hasn't installed an executable called python, but it does have python3. So this needs changing to:

!/usr/bin/env python3

I can't seem to find the source for sum.py apart from a checked in zip file either or I would have entered a pull request. Is it built from another repository?

jcohen02 commented 2 years ago

Thanks for highlighting this @colinsauze. This actually only became an issue right at the end of the "Creating More Complex Container Images" section since we were directly specifying the executable as python3 in the earlier examples in that section. Nonetheless, this is something that needed fixing.

A further question, in relation to your comment:

I can't seem to find the source for sum.py apart from a checked in zip file either or I would have entered a pull request. Is it built from another repository?

is whether this zip file should be automatically generated from source files within the repository by (e.g.) GitHub Actions? I guess this would be a more sustainable option and would make changes much easier to track - at the same time, I'm not overkeen on having GHA automatically add new commits to the repo, although maybe that's not an issue, I'm aware that there are various cases where this is done and there are actions to support this workflow. Thoughts?