I’m trying to use a private repo and found the following documentation How to Build Go Apps with Paketo Buildpacks - Paketo Buildpacks but I don’t know how to pass those arguments in my fly.toml
Is this possible? Thanks!
I’m trying to use a private repo and found the following documentation How to Build Go Apps with Paketo Buildpacks - Paketo Buildpacks but I don’t know how to pass those arguments in my fly.toml
Is this possible? Thanks!
For eventual future readers: my solution was to write a Dockerfile to build and run the app instead of using Paketo. The tricky part (at least to me, since I don’t use Docker) was securely setting up the private repo access in the Dockerfile:
RUN go env -w GOPRIVATE=github.com/your_user_or_org/*
RUN --mount=type=secret,id=GITHUB_TOKEN,required \
GITHUB_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \
&& git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
Then you can set GITHUB_TOKEN when deploying:
fly deploy --build-secret GITHUB_TOKEN=${GITHUB_TOKEN}
Please let me know if there is a better approach!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.