-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support '--ssh' option in 'docker build' #4660
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# syntax=docker/dockerfile:1.0.0-experimental | ||
|
||
FROM alpine:3.10 | ||
|
||
# https://github.com/tonistiigi/buildkit/blob/1604b1b9ed70bcbc002033d8dd0e65ab13f13554/client/llb/exec.go#L138 | ||
RUN --mount=type=ssh ls /run/buildkit/ssh_agent.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: skaffold/v2beta10 | ||
kind: Config | ||
build: | ||
local: | ||
useBuildkit: true | ||
push: false | ||
artifacts: | ||
- image: ssh | ||
docker: | ||
ssh: "default" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1125,6 +1125,9 @@ type DockerArtifact struct { | |
// Secret contains information about a local secret passed to `docker build`, | ||
// along with optional destination information. | ||
Secret *DockerSecret `yaml:"secret,omitempty"` | ||
|
||
// SSH is used to pass in --ssh to docker build to use SSH agent. Format is "default|<id>[=<socket>|<key>[,<key>]]". | ||
SSH string `yaml:"ssh,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wondering what to do here. "--ssh" option can have only one argument "default", "<id>[=<socket>]" or "<key>[,<key>]". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SGTM — I think we could use a yaml |
||
} | ||
|
||
// DockerSecret contains information about a local secret passed to `docker build`, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is ad hoc and not very good, but I think it's out of the scope of this PR to refactor these and the only options that BuildKit needs, for now, are "secret" and "ssh" so I'll leave that for this PR I'll leave it.