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

allow lower bound version pinning for apk (DL3018) #812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stonecharioteer
Copy link

@stonecharioteer stonecharioteer commented Apr 1, 2022

This PR addresses #782.

@lorenzo this is still a WIP, since my test is failing. I've never written haskell code before, so perhaps I'm missing something.

What I did

I've added an or section to the check for DL3018 so that it allows >= in apk add steps.

How I did it

I followed @lorenzo's instructions on #782.

How to verify it

stack test

The tests still fail, I'm not sure how to fix that. I could use some help there.

Aside: Additionally, this is a thing that could be used in all places where lower bounds are respected by the OS. This is supported even by yum, apt and pip. Should I implement it for those as well?

Thank you for guiding me in fixing this.

@stonecharioteer
Copy link
Author

@lorenzo here's the error I get.
2022-04-01-102105_1079x150_scrot

@stonecharioteer stonecharioteer changed the title FEAT: allow lower bound for dl3018 allow lower bound version pinning for apk (DL3018) Apr 1, 2022
@lorenzo
Copy link
Member

lorenzo commented Apr 1, 2022

I'll take a look today

@stonecharioteer
Copy link
Author

@lorenzo did you get time to take a look?

@m-ildefons
Copy link
Collaborator

Hi @stonecharioteer ,
The apk add command here is first parsed as shell, then parsed by the rule. Since > indicates redirection in POSIX shells, you need to make sure your version bounds are either quoted or escaped properly, e.g.:

RUN apk add --no-cache \
    "flex>=2.6.4-r1"

or in the test suite:

    let dockerfile =
        [ "RUN apk add --no-cache \\",
          "\"flex>=2.6.4-r1\" \\",
          "\"libffi>=3.2.1-r3\""
        ]

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

Successfully merging this pull request may close these issues.

None yet

3 participants