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

Enhance 'pipefail' warnings #6

Open
srcshelton opened this issue Jun 30, 2020 · 0 comments
Open

Enhance 'pipefail' warnings #6

srcshelton opened this issue Jun 30, 2020 · 0 comments

Comments

@srcshelton
Copy link

When a RUN block contains a pipeline, not having set pipefail results in:

/ER0001/ Set the SHELL option -o(-eo for Alpine image) pipefail before RUN with a pipe in

... whilst having set pipefail (correctly) by default gives:

/SC2039/ In POSIX sh, set option pipefail is undefined.

I'm not sure of a good solution to this since docker/podman/buildah use the container's sh rather than a bundled standardised version - the -s option can be set on the command-line, but is there a directive which sets this and can be used inline in a file.

Also, using set -o pipefail at the top of a block containing a pipeline doesn't quell the warning when the pipeline (for which pipefail is now active) is encountered - in fact, all of these generate ER0001:

RUN set -o pipefail ; \
    ... \
    cmd1 | cmd2
RUN set -o pipefail && \
    ... \
    cmd1 | cmd2
RUN ... \
    set -o pipefail ; cmd1 | cmd2
RUN ... \
    set -o pipefail && cmd1 | cmd2

... so I'm unsure as to what syntax can be used to avoid triggering this error.

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

1 participant