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

Add support for RUN --mount=type=secret env #101

Open
fox91 opened this issue Nov 5, 2024 · 0 comments
Open

Add support for RUN --mount=type=secret env #101

fox91 opened this issue Nov 5, 2024 · 0 comments

Comments

@fox91
Copy link

fox91 commented Nov 5, 2024

Already reported by hadolint/hadolint/issues/1039 but need to be solved here:

secretMount :: [RunMountArg] -> Parser SecretOpts
secretMount args =
case validArgs "secret" allowed required args of
Left e -> customError e
Right as -> return $ foldr secretOpts def as
where
allowed = Set.fromList ["target", "id", "required", "source", "mode", "uid", "gid"]

Example:

# syntax=docker/dockerfile:1.10

FROM node:20

RUN --mount=type=secret,id=ENV_VAR,env=ENV_VAR echo "ENV_VAR=$ENV_VAR" > /tmp/env_var

Exit with error:

Dockerfile.test:6:36 unexpected "env=ENV_VAR ec" expecting "gid=", "id=", "mode=", "required", "required=False", "required=True", "required=false", "required=true", "uid=", source=, or target=
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