Skip to content

port --secret and --ssh support#323

Merged
AkihiroSuda merged 2 commits into
genuinetools:masterfrom
alefray:port-build-secret
Feb 12, 2021
Merged

port --secret and --ssh support#323
AkihiroSuda merged 2 commits into
genuinetools:masterfrom
alefray:port-build-secret

Conversation

@alefray
Copy link
Copy Markdown
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:

Comment thread Makefile

# Set any default go build tags
BUILDTAGS ?= seccomp osusergo
BUILDTAGS ?= seccomp osusergo dfrunmount dfsecrets dfssh
Copy link
Copy Markdown
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
Copy Markdown
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 ?

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

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