Skip to content

Instantly share code, notes, and snippets.

@alexrashed
Created June 20, 2023 11:47
Show Gist options
  • Save alexrashed/70b0b21de74a269d710441d1c3f00e96 to your computer and use it in GitHub Desktop.
Save alexrashed/70b0b21de74a269d710441d1c3f00e96 to your computer and use it in GitHub Desktop.
Dockerfile buildx secret env
#!/bin/bash
GITHUB_TOKEN="very secret github token!" docker buildx build --progress plain --no-cache --secret id=GITHUB_TOKEN .
# syntax=docker/dockerfile:1.3
FROM busybox
RUN --mount=type=secret,id=GITHUB_TOKEN echo "This is the token: $(cat /run/secrets/GITHUB_TOKEN)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment