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(deps): error obtaining VCS status: exit status 128 at docker build #990

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

ryukinix
Copy link
Contributor

How to replicate the error: make docker

Previous error:

... long log
 ---> f394d136bb6c
Step 7/24 : ADD proto/go.sum proto/go.sum
 ---> 7fca7e520cb3
Step 8/24 : ENV CGO_ENABLED 1
 ---> Running in ca87bf346155
Removing intermediate container ca87bf346155
 ---> af2dbef0c762
Step 9/24 : RUN go mod download
 ---> Running in 98785997fa9c
Removing intermediate container 98785997fa9c
 ---> f74577fb6d14
Step 10/24 : ADD . .
 ---> f1cc0ac767f0
Step 11/24 : RUN go build -tags sqlite -o /usr/bin/keto .
 ---> Running in 913258959d81
error obtaining VCS status: exit status 128
	Use -buildvcs=false to disable VCS stamping.
The command '/bin/sh -c go build -tags sqlite -o /usr/bin/keto .'
returned a non-zero code: 1

This is fixed by setting -buildvcs=false flag

ref: golang/go#49004

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

@CLAassistant
Copy link

CLAassistant commented Aug 19, 2022

CLA assistant check
All committers have signed the CLA.

@ryukinix ryukinix changed the title Fix error obtaining VCS status: exit status 128 at docker build fix(dockerfile): error obtaining VCS status: exit status 128 Aug 19, 2022
@ryukinix ryukinix changed the title fix(dockerfile): error obtaining VCS status: exit status 128 fix(build): error obtaining VCS status: exit status 128 Aug 19, 2022
@ryukinix ryukinix changed the title fix(build): error obtaining VCS status: exit status 128 fix(deps): error obtaining VCS status: exit status 128 at docker build Aug 19, 2022
@ryukinix
Copy link
Contributor Author

cc: @mfrata

@ryukinix
Copy link
Contributor Author

Another option: ko-build/ko#672

Use GOFLAGS environment var instead fixing directly the dockerfile

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Seems good to me.
Did you figure out why it fails in the first place? Git is installed in the builder, and .git should also be added 🤔

How to replicate the error: `make docker`

Previous error:
```
... long log
 ---> f394d136bb6c
Step 7/24 : ADD proto/go.sum proto/go.sum
 ---> 7fca7e520cb3
Step 8/24 : ENV CGO_ENABLED 1
 ---> Running in ca87bf346155
Removing intermediate container ca87bf346155
 ---> af2dbef0c762
Step 9/24 : RUN go mod download
 ---> Running in 98785997fa9c
Removing intermediate container 98785997fa9c
 ---> f74577fb6d14
Step 10/24 : ADD . .
 ---> f1cc0ac767f0
Step 11/24 : RUN go build -tags sqlite -o /usr/bin/keto .
 ---> Running in 913258959d81
error obtaining VCS status: exit status 128
	Use -buildvcs=false to disable VCS stamping.
The command '/bin/sh -c go build -tags sqlite -o /usr/bin/keto .'
returned a non-zero code: 1
```

This is fixed by setting -buildvcs=false

ref: golang/go#49004
@ryukinix
Copy link
Contributor Author

ryukinix commented Aug 24, 2022

Did you figure out why it fails in the first place?

Unfortunately no, I tried another approachs as described here golang/go#49004, but the unique way I got to make it work was passing this flag.

@ryukinix
Copy link
Contributor Author

@zepatrik

Actually I guess it can be related to the way I structured the project that will use keto.

I added keto repository as submodule of another git repository that I am building as part of access control solution.

By using git submodule, the .git it's a file with some metadata instead of a directory.

I think this is the reason, since it's not failing in the github CI, but fails in mine and my local clone (as submodule).

@zepatrik zepatrik merged commit 97f638d into ory:master Aug 25, 2022
@ryukinix ryukinix deleted the fix-docker-build-vcs-bug branch August 25, 2022 16:46
@vinckr
Copy link
Member

vinckr commented Sep 5, 2022

Hello @ryukinix
Congrats on merging your first PR in Ory 🎉 !
Your contribution will soon be helping secure millions of identities around the globe 🌏.
As a small token of appreciation we send all our first time contributors a gift package to welcome them to the community.
Please drop me an email and I will forward you the form to claim your Ory swag!

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.

4 participants