`docker run` on a remote host

前端 未结 4 1844
自闭症患者
自闭症患者 2020-12-30 01:30

is it possible (using the docker command or the docker-py API directly) to start a container from a remote host?

Lets assume I have two mac

4条回答
  •  孤独总比滥情好
    2020-12-30 02:18

    Check if the latest docker 18.09 includes that feature.
    See docker/cli PR 1014

    Added support for SSH connection. e.g. docker -H ssh://me@server

    • The cli should accept ssh://me@server for DOCKER_HOST and -H. Using that would execute ssh with the passed config.
    • The ssh command would call a hidden command on the docker CLI binary on the remote side. For example, docker dial-stdio.

    This command will make a connection to the local DOCKER_HOST variable (almost always the default local socket) and forward that connection on the commands stdio.
    Even though this command is supposed to run locally to the dockerd binary, we think that it is an invalid configuration for this feature to remove the local docker binary so we can rely on it always being present.

    How to verify it

    docker -H ssh://me@server run -it --rm busybox
    

    The reaction so far:

    From ops and sysadmins everywhere, we thank you for this fantastic and unexpected feature.
    I'm hoping this will seriously cut down the number of times I see people opening dockerd TCP w/o TLS and just opt for SSH endpoints for remote mgmt.

提交回复
热议问题