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

--src-daemon-host does not work with SSH based docker daemon #1824

Open
abdennour opened this issue Dec 11, 2022 · 4 comments
Open

--src-daemon-host does not work with SSH based docker daemon #1824

abdennour opened this issue Dec 11, 2022 · 4 comments
Labels
kind/feature A request for, or a PR adding, new functionality stale-issue

Comments

@abdennour
Copy link

Docker supports 3 ways to connect to its damon:

  1. Famous: /var/run/docker.sock
  2. TCP thru env var DOCKER_HOST
  3. SSH thru docker contexts & DOCKER_CONTEXT env var.

The current skoepo supports (1) and (2).. However no way to let it work with (3).

My docker context ls shows something like the following:

NAME          DESCRIPTION                               DOCKER ENDPOINT               KUBERNETES ENDPOINT                    ORCHESTRATOR
default       Current DOCKER_HOST  unix:///var/run/docker.sock                                               (default)   swarm
dev *                                                      ssh://[email protected]

As demonstrated, the current context is the one which had * .. in my example, it's dev.

Now trying to use skopeo with that context:

skopeo copy --src-daemon-host=ssh://[email protected]  ....

But unfortunately, skopeo consider it as https :(

FATA[0000] Error initializing source docker-daemon:testdebug-mini_app:latest: 
Error loading image from docker engine: error during connect: 
Get  https://user%4010.x.y.z/v1.22/images/get?names=testdebug-mini_app%3Alatest"

Any solution ? any workaround to let it work ?

@mtrmac
Copy link
Contributor

mtrmac commented Dec 12, 2022

Thanks for your report.

It seems that this is a feature specific to the Docker CLI, not to the provided client libraries (in https://github.com/docker/cli/blob/ab794859fe792cc4b6d1632b919b775613bc17fc/cli/connhelper/connhelper.go#L43 ); so that would not be available in Skopeo right now.

From a quick look it doesn’t seem trivially possible to emulate that (the ssh command could be run manually, but the docker-daemon: client expects to connect to a socket, so there would need to be a local socket server). Maybe some combination of nc and ssh could work, I didn’t look in to this further right now.

@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label Dec 12, 2022
@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@swarren
Copy link

swarren commented Sep 13, 2023

Presumably this could be emulated via ssh -R or ssh -L; this is exactly what I'm doing manually in issue 2017.

Copy link

A friendly reminder that this issue had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants