Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rcfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
rcfiles
Commits
bfbbef4a
Commit
bfbbef4a
authored
5 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Control output from docker-remote.
So now I can run `$(eval docker remote hostname)`.
parent
a60a7eff
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documents/bin/_docker-remote
+2
-3
2 additions, 3 deletions
Documents/bin/_docker-remote
Documents/bin/forward
+5
-1
5 additions, 1 deletion
Documents/bin/forward
with
7 additions
and
4 deletions
Documents/bin/_docker-remote
+
2
−
3
View file @
bfbbef4a
#!/bin/sh
#!/bin/sh
set
-eu
set
-eu
[
-n
"
$1
"
]
||
{
echo
"You must specify host."
>
&2
;
exit
1
;
}
[
-n
"
$1
"
]
||
{
echo
"You must specify host."
>
&2
;
exit
1
;
}
host
=
"
$1
"
host
=
"
$1
"
localsocket
=
"
$HOME
/.ssh/docker_
$host
.sock"
localsocket
=
"
$HOME
/.ssh/docker_
$host
.sock"
lsof
-t
"
$localsocket
"
>
/dev/null
||
rm
"
$localsocket
"
lsof
-t
"
$localsocket
"
>
/dev/null
2>&1
||
rm
-f
"
$localsocket
"
forward
"
$host
"
"
$localsocket
:/var/run/docker.sock"
forward
"
$host
"
"
$localsocket
:/var/run/docker.sock"
>
/dev/null 2>&1
# Echo the DOCKER_HOST export command, for eval'ing.
# Echo the DOCKER_HOST export command, for eval'ing.
echo
"export DOCKER_HOST=unix://
$localsocket
"
echo
"export DOCKER_HOST=unix://
$localsocket
"
This diff is collapsed.
Click to expand it.
Documents/bin/forward
+
5
−
1
View file @
bfbbef4a
...
@@ -10,6 +10,10 @@ forward="$2" || { usage >&2; exit 1; }
...
@@ -10,6 +10,10 @@ forward="$2" || { usage >&2; exit 1; }
alias
ssh
=
'ssh -fnNTS ~/.ssh/%C.sock'
alias
ssh
=
'ssh -fnNTS ~/.ssh/%C.sock'
# shellcheck disable=SC2029
# shellcheck disable=SC2029
ssh
-o
ControlMaster
=
auto
-o
ControlPersist
=
0
-o
ExitOnForwardFailure
=
no
-o
ControlPersist
=
0
"
$host
"
ssh
-o
ControlMaster
=
auto
\
-o
ControlPersist
=
0
\
-o
ExitOnForwardFailure
=
no
\
-o
ControlPersist
=
0
\
"
$host
"
# shellcheck disable=SC2029
# shellcheck disable=SC2029
ssh
-O
forward
-L
"
$forward
"
"
$host
"
ssh
-O
forward
-L
"
$forward
"
"
$host
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment