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 #186

Closed
wants to merge 1 commit into from
Closed

fix COPY .git #186

wants to merge 1 commit into from

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 force-pushed the add-instead-of-copy branch 4 times, most recently from 77dae90 to 2c404ce Compare March 15, 2024 19:55
@stephanos stephanos changed the title use ADD instead of COPY for .git fix COPY .git Mar 15, 2024
@stephanos stephanos marked this pull request as ready for review March 15, 2024 20:14
@stephanos stephanos requested a review from a team as a code owner March 15, 2024 20:14
@@ -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? ./.git

Choose a reason for hiding this comment

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

We could also use .gi[t] I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me get this out to unblock folks; and then I can try this one as a follow-up PR.

@stephanos stephanos mentioned this pull request Mar 15, 2024
@stephanos stephanos closed this Mar 15, 2024
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.

None yet

3 participants