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

fix COPY .git #2 #187

Merged
merged 2 commits into from
Mar 15, 2024
Merged

fix COPY .git #2 #187

merged 2 commits into from
Mar 15, 2024

Conversation

stephanos
Copy link
Contributor

@stephanos stephanos commented Mar 15, 2024

What was changed

Fixing COPY for adding .git directories.

Why?

https://github.com/temporalio/temporal/actions/runs/8299631664/job/22717105934?pr=5507

server.Dockerfile:27
--------------------
  25 |     # Git info is needed for Go build to attach VCS information properly.
  26 |     # See the `buildvcs` Go flag: https://pkg.go.dev/cmd/go
  27 | >>> COPY ./.git ./.git
  28 |     COPY ./.gitmodules ./.gitmodules
  29 |     RUN --mount=type=cache,target=/root/.cache/go-build (cd ./temporal && make temporal-server)
--------------------
ERROR: failed to solve: source can't be a git ref for COPY
Error: buildx bake failed with: ERROR: failed to solve: source can't be a git ref for COPY

Might be related to moby/buildkit#4326 and actions/runner-images#9482

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@stephanos stephanos changed the title Fix copy 2 Fix COPY of .git Mar 15, 2024
@stephanos stephanos changed the title Fix COPY of .git fix COPY .git Mar 15, 2024
@stephanos stephanos changed the title fix COPY .git fix COPY .git #2 Mar 15, 2024
@stephanos stephanos marked this pull request as ready for review March 15, 2024 20:32
@stephanos stephanos requested a review from a team as a code owner March 15, 2024 20:32
@stephanos stephanos enabled auto-merge (squash) March 15, 2024 20:33
@stephanos stephanos merged commit 3505cb6 into main Mar 15, 2024
5 checks passed
@stephanos stephanos deleted the fix-copy-2 branch March 15, 2024 20:35
@@ -15,7 +15,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build (cd ./temporal && go mod dow
COPY ./temporal ./temporal
# Git info is needed for Go build to attach VCS information properly.
# See the `buildvcs` Go flag: https://pkg.go.dev/cmd/go
COPY ./.git ./.git
# NOTE: `COPY ./.git ./.git` will fail in Docker as COPY isn't allowed to add git repositories
COPY ./.gi[t] ./.git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can potentially also resolve this with COPY .git ./.git

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

Successfully merging this pull request may close these issues.

3 participants