Skip to content

fix COPY .git #2#187

Merged
stephanos merged 2 commits intomainfrom
fix-copy-2
Mar 15, 2024
Merged

fix COPY .git #2#187
stephanos merged 2 commits intomainfrom
fix-copy-2

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 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
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[t] ./.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.

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