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

Using ssh to access private data in builds? #4

Open
ghost opened this issue Jun 26, 2020 · 1 comment
Open

Using ssh to access private data in builds? #4

ghost opened this issue Jun 26, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 26, 2020

Using ssh to access private data in builds does not see to work with the makefile.

I get:

 => ERROR [5/9] RUN --mount=type=ssh,required GIT_SSH_COMMAND="ssh -v" git clone --progress --verbose [email protected]:worldr/private.git /app     && gi  0.1s
------
[…]
------
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to build LLB: no SSH key "" forwarded from the client
make: *** [../make/Makefile:67: docker-build] Error 1
@ghost
Copy link
Author

ghost commented Jun 26, 2020

This is a trivial fix.

In the Makefile, replace:

docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH)

with

docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_SSH) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH)

Note the new $(DOCKER_SSH) variable. In the subdirectory Makefile that need it, set

DOCKER_SSH=--ssh default

That is it.

@mvanholsteijn Do you want me to open a PR for this or is this enough?

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

No branches or pull requests

0 participants