[GH-ISSUE #18] Support Docker with SSH authentication #12

Closed
opened 2026-03-01 21:39:06 +03:00 by kerem · 5 comments
Owner

Originally created by @AlexGustafsson on GitHub (Jan 22, 2019).
Original GitHub issue: https://github.com/nektos/act/issues/18

I noticed remote Docker support was more or less fixed somewhere after #5, but it does not seem to work for hosts that I connect to over SSH. Since Docker 18.09 there's been support to use docker -H ssh://me@server. Is there any way that could work with this project as well?

Error I get for reference:

Error: error during connect: Post http://alex%40192.168.xx.xx/v1.39/images/create?fromImage=node&tag=11.6.0: dial tcp: lookup alex@192.168.xx.xx: no such host
macOS 10.13.6 (17G5019)
sample repo from README: https://github.com/cplee/github-actions-demo
Originally created by @AlexGustafsson on GitHub (Jan 22, 2019). Original GitHub issue: https://github.com/nektos/act/issues/18 I noticed remote Docker support was more or less fixed somewhere after #5, but it does not seem to work for hosts that I connect to over SSH. Since Docker 18.09 there's been support to use `docker -H ssh://me@server`. Is there any way that could work with this project as well? Error I get for reference: ``` Error: error during connect: Post http://alex%40192.168.xx.xx/v1.39/images/create?fromImage=node&tag=11.6.0: dial tcp: lookup alex@192.168.xx.xx: no such host ``` ``` macOS 10.13.6 (17G5019) sample repo from README: https://github.com/cplee/github-actions-demo ```
Author
Owner

@cplee commented on GitHub (Jan 22, 2019):

@AlexGustafsson have you tried setting env variable like DOCKER_HOST=ssh://me@server

<!-- gh-comment-id:456579137 --> @cplee commented on GitHub (Jan 22, 2019): @AlexGustafsson have you tried setting env variable like `DOCKER_HOST=ssh://me@server`
Author
Owner

@SvenDowideit commented on GitHub (Jan 23, 2019):

I get a very similar result from setting DOCKER_HOST

dow184@TOWER-SL:~/src/github/act$ echo $DOCKER_HOST
ssh://onacitest
dow184@TOWER-SL:~/src/github/act$ docker info | grep onacitest
WARNING: No swap limit support
Name: onacitest
dow184@TOWER-SL:~/src/github/act$ make
go run main.go -ra check
[check] docker build -t check:1f5cf30 /home/dow184/src/github/act/.github/actions/check
Error: error during connect: Post http://onacitest/v1.24/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=check%3A1f5cf30&target=&ulimits=null&version=: dial tcp: lookup onacitest on 127.0.0.53:53: server misbehaving
exit status 1
Makefile:20: recipe for target 'check' failed
make: *** [check] Error 1
<!-- gh-comment-id:456623406 --> @SvenDowideit commented on GitHub (Jan 23, 2019): I get a very similar result from setting DOCKER_HOST ``` dow184@TOWER-SL:~/src/github/act$ echo $DOCKER_HOST ssh://onacitest dow184@TOWER-SL:~/src/github/act$ docker info | grep onacitest WARNING: No swap limit support Name: onacitest dow184@TOWER-SL:~/src/github/act$ make go run main.go -ra check [check] docker build -t check:1f5cf30 /home/dow184/src/github/act/.github/actions/check Error: error during connect: Post http://onacitest/v1.24/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=check%3A1f5cf30&target=&ulimits=null&version=: dial tcp: lookup onacitest on 127.0.0.53:53: server misbehaving exit status 1 Makefile:20: recipe for target 'check' failed make: *** [check] Error 1 ```
Author
Owner

@SvenDowideit commented on GitHub (Jan 23, 2019):

Actually, I think this is isn't going to work with the current way the code works.

From what I can see, your repository is bind-mounted into the container - which means that it only supports "local" Docker daemons (where Docker for windows and Docker for Mac are considered "local")

from a docker inspect on the remote Docker:

        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/dow184/src/github/act",
                "Destination": "/github/workspace",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
<!-- gh-comment-id:456642630 --> @SvenDowideit commented on GitHub (Jan 23, 2019): Actually, I think this is isn't going to work with the current way the code works. From what I can see, your repository is bind-mounted into the container - which means that it only supports "local" Docker daemons (where Docker for windows and Docker for Mac are considered "local") from a docker inspect on the remote Docker: ``` "Mounts": [ { "Type": "bind", "Source": "/home/dow184/src/github/act", "Destination": "/github/workspace", "Mode": "", "RW": true, "Propagation": "rprivate" }, ```
Author
Owner

@SvenDowideit commented on GitHub (Jan 23, 2019):

playing with it in #19

<!-- gh-comment-id:456647352 --> @SvenDowideit commented on GitHub (Jan 23, 2019): playing with it in #19
Author
Owner

@AlexGustafsson commented on GitHub (Jan 23, 2019):

I realise I was being a bit unclear, I do in fact use the environment variable and not the -h flag as shown above.

I’ll follow your progress over at #19.

<!-- gh-comment-id:456710240 --> @AlexGustafsson commented on GitHub (Jan 23, 2019): I realise I was being a bit unclear, I do in fact use the environment variable and not the `-h` flag as shown above. I’ll follow your progress over at #19.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#12
No description provided.