Skip to content

Instantly share code, notes, and snippets.

@KavyrshinR
Created December 26, 2025 00:12
Show Gist options
  • Select an option

  • Save KavyrshinR/d2312c4acb86b99fe39028c81dc785de to your computer and use it in GitHub Desktop.

Select an option

Save KavyrshinR/d2312c4acb86b99fe39028c81dc785de to your computer and use it in GitHub Desktop.
pass secrets in docker
in Dockerfile
other steps...
RUN --mount=type=secret,id=sentry_auth_token,env=SENTRY_AUTH_TOKEN \
./gradlew --no-daemon build
... other steps
build command
docker build --secret id=sentry_auth_token,src=sentry_auth_token.secret \
-t rom-kavyrshin/java-project-99 -f Dockerfile .
###############################
RUN --mount=type=secret,id=<имя_секрета>,env=<имя_переменной> \
./gradlew build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment