Skip to content

fix COPY .git#186

Closed
stephanos wants to merge 1 commit intomainfrom
add-instead-of-copy
Closed

fix COPY .git#186
stephanos wants to merge 1 commit intomainfrom
add-instead-of-copy

Conversation

@stephanos
Copy link
Copy Markdown
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 force-pushed the add-instead-of-copy branch from 2c404ce to 2090a72 Compare March 15, 2024 20:06
@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
Comment thread admin-tools.Dockerfile
# 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
Copy link
Copy Markdown

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
Copy Markdown
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.

3 participants