Remove GitHub app usage now that attest is public

Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
This commit is contained in:
Jonny Stoten
2024-10-23 10:23:58 +01:00
parent 05fee12fb7
commit 56874d0b3a
4 changed files with 4 additions and 48 deletions

View File

@@ -20,24 +20,12 @@ ENV CGO_ENABLED=0
WORKDIR /app
# --- This block can be removed when github.com/docker/attest is public
ENV GOPRIVATE="github.com/docker/attest"
RUN --mount=type=secret,id=GITHUB_TOKEN <<EOT
set -e
GITHUB_TOKEN=${GITHUB_TOKEN:-$(cat /run/secrets/GITHUB_TOKEN)}
if [ -n "$GITHUB_TOKEN" ]; then
echo "Setting GitHub access token"
git config --global "url.https://x-access-token:${GITHUB_TOKEN}@github.com.insteadof" "https://github.com"
fi
EOT
# ---
ARG VERSION="dev"
RUN --mount=type=bind,source=.,target=/app \
--mount=type=cache,target=$GOPATH/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags "-X main.version=$VERSION" -o /bin/attest main.go
--mount=type=cache,target=$GOPATH/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags "-X main.version=$VERSION" -o /bin/attest main.go
FROM ${BASEIMAGE} AS production