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

port --secret and --ssh support #323

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

alefray
Copy link
Contributor

@alefray alefray commented Dec 31, 2020

This PR resolves #198

The current implementation of img build does not support --secret and --ssh arguments nor accept RUN --mount=... instruction.
These features are now in GA since docker 20.10 and would be a great addition to img

This work is largely inspired from:

Few comments about this work:

  • moby/buildkit must be built with tags dfrunmount dfsecrets dfssh for --secret and --ssh support
  • A private key has been added for TestBuildSsh. I'm not sure if this was the best way to make a unit test for --ssh

References:

@@ -5,7 +5,7 @@ PKG := github.com/genuinetools/$(NAME)
CGO_ENABLED := 1

# Set any default go build tags
BUILDTAGS ?= seccomp osusergo
BUILDTAGS ?= seccomp osusergo dfrunmount dfsecrets dfssh
Copy link
Collaborator

Choose a reason for hiding this comment

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

These tags should not be needed if you vendor the latest version of BuildKit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After trying a bit, vendoring the latest (8.1.0) version of BuildKit requires much more effort as it impacts refactoring "pull" and "push" commands due to changes on sessions (e.g., moby/buildkit#1551).

Wouldn't it be better if we open a dedicated issue/PR ?

testdata/test-ssh.pem Outdated Show resolved Hide resolved
@AkihiroSuda AkihiroSuda merged commit 132b56c into genuinetools:master Feb 12, 2021
@gabyx
Copy link

gabyx commented Dec 24, 2021

Would it be possible to support id=git,env=PASSWORD as well?

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.

Port over docker build --secret and docker build --ssh (low hanging fruit)
3 participants