Skip to content

Conversation

x893675
Copy link
Contributor

@x893675 x893675 commented Nov 15, 2023

What this PR does / why we need it:

push image to self-signed certificate registry will throw failed to authorize: failed to fetch oauth token: Post \"https://harbor/service/token\": tls: failed to verify certificate: x509: certificate signed by unknown authority .

I have to provide the certificate using the--registry-auth-tlscontext flag. But in most usage scenarios, I cannot provide the certificate file.

Additional usage docs, etc.:

when i build and push image to self-signed harbor harbor-registry.com, and not provide cert

buildctl build --frontend dockerfile.v0 -local context=. -local dockerfile=./ --opt filename=Dockerfile --opt platform="linux/amd64" --output type=image,name=harbor-registry.com/demo/demo:latest,push=true,registry.insecure=true --registry-auth-tlscontext host=harbor-registry.com,insecure=true

.gitignore Outdated
@@ -4,3 +4,5 @@
bin
.certs
.tmp
.idea
Copy link
Member

Choose a reason for hiding this comment

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

remove these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

Squash the commits as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@x893675 x893675 force-pushed the buildctl-push-self-signed-registry branch from ac3f1b1 to 0b791f5 Compare November 16, 2023 01:52
Signed-off-by: x893675 <x893675@icloud.com>
@x893675 x893675 force-pushed the buildctl-push-self-signed-registry branch from 0b791f5 to 5099010 Compare November 16, 2023 03:25
@x893675
Copy link
Contributor Author

x893675 commented Nov 16, 2023

@tonistiigi
run make docs fix ci check failed.
help reivew

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.

2 participants