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

Unable to --allow-privileged when using artifact reference syntax with FROM DOCKERFILE #3706

Closed
dustyhorizon opened this issue Jan 14, 2024 · 1 comment · Fixed by #3818
Closed
Labels
type:bug Something isn't working

Comments

@dustyhorizon
Copy link
Contributor

dustyhorizon commented Jan 14, 2024

What went wrong?
When the build chain requires RUN --privileged ..., FROM DOCKERFILE is not able to propagate the necessary flags to allow the artifacts to be properly copied.

A minimal Earthfile to reproduce this is as follows:

VERSION 0.7

source:
    RUN \
        --privileged \
        \
        set -ex \
        && touch a

    SAVE ARTIFACT a

build:
    FROM DOCKERFILE \
        -f +source/a \
        +source

It is also noted that there are no flags to specify --allow-privileged within a FROM DOCKERFILE command.

What should have happened?
By specifying earthly --allow-privileged +build I should be able to perform the build.

Other Helpful Information
Output from the minimal reproduction

❯ earthly -i -P +build
 Init 🚀
————————————————————————————————————————————————————————————————————————————————

           buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)

 Build 🔧
————————————————————————————————————————————————————————————————————————————————

Error: Earthfile line 13:4 from dockerfile: earthfile2llb for +source: Earthfile line 4:4 Permission denied: unwilling to run privileged command; did you reference a remote Earthfile without the --allow-privileged flag?
in              x:develop+source
in              x:develop+build
🛰️ Reuse cache between CI runs with Earthly Satellites! 2-20X faster than without cache. Generous free tier https://cloud.earthly.dev
@dustyhorizon dustyhorizon added the type:bug Something isn't working label Jan 14, 2024
@dustyhorizon dustyhorizon changed the title Unable to --allow-privileged when attempting to copy artifacts within FROM DOCKERFILE Unable to --allow-privileged when using artifact reference syntax with FROM DOCKERFILE Jan 14, 2024
@dustyhorizon
Copy link
Contributor Author

Still an issue on Earthly v0.8.3 with VERSION 0.8

alexcb pushed a commit that referenced this issue Feb 28, 2024
Adds `--allow-privileged` flag to `FROM DOCKERFILE` command.

Fixes #3706
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant