Skip to content

can't build from dev.Dockerfile when using git worktree #1022

Open
@ZZiigguurraatt

Description

@ZZiigguurraatt

I use git worktree so that I can easily work on many branches at once. However, if I try to build using dev.Dockerfile, this does not work. I get the following error:

87.40 $ git restore build/.gitkeep
87.41 fatal: not a git repository: /go/src/github.com/lightninglabs/lightning-terminal/../.bare/worktrees/database_build_flags
87.42 error Command failed with exit code 128.
87.42 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: executor failed running [/bin/sh -c cd /go/src/github.com/lightninglabs/lightning-terminal/app   && yarn install   && yarn build]: exit code: 128

Inside the worktree on the host I run:

$ cat .git
gitdir: ../.bare/worktrees/database_build_flags
$

This directory exists on the host, but inside the docker container it does not because it is not copied in by

# Copy in the local repository to build from.
COPY . /go/src/github.com/lightninglabs/lightning-terminal
.

If I remove this line

"postbuild": "git restore build/.gitkeep",
it works.

Building outside of docker does work without removing that line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions