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

Funnyness and semantically void pip version specification on Dockerfile #16

Open
alexbarcelo opened this issue Jul 30, 2024 · 1 comment

Comments

@alexbarcelo
Copy link

Level

MINOR

Component

Container creation

Description

Funnyness on version specification of pip on various Dockerfile (at least base/Dockerfile and tutorial/Dockerfile, maybe others).

The character > is used by bash to redirect output. The current Dockerfile tries to use several >= version specification on the pip command (e.g. on https://github.com/bsc-wdc/compss/blob/stable/utils/docker/base/Dockerfile#L53 ). But that is misconstrued due to the bash processing that.

The outcome is that the stdout of this command goes to the file =2.2.3 and so on. The pip command only "sees" the install matplotlib, not the >=2.2.3 (because it is interpreted by the shell). The final outcome is a container that contains several files =0.24.2, =1.0.2 and etc. which are a badge of shame of misconstructed pip install command (been there done that).

This should be solved escaping the > the pip command. Typically, pip install versions are always defined with quotes to avoid pitfalls and to ensure no funny business. So pip install "matplotlib>=2.2.3" "scipy>=..." etc. For == it is not necessary, but it does no harm, and is a good habit.

Fortunately the system does not break because by default pip will try to install last version. However, as it is, the Dockerfile installation is semantically incorrect and doing it wrong in general may result in unexpected behavior (e.g. if in the future, if some pip install requires a <=: not escaping that would result in more catastrophic failure).

Minimal example to reproduce

It is in plain sight on various COMPSs containers, and its files in the root (e.g. /=0.24.2).

@fjconejero
Copy link
Member

Fixed in upcoming Dockerfile version.

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

2 participants