Skip to content

Commit

Permalink
Add share-ssh-socket config option
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsauter committed Apr 2, 2018
1 parent 4210bd1 commit 5f90aef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* [Task] Check less frequently for updates (once every 14 days).

* [Feature] Add an easy way to share the SSH socket with a container by adding the `share-ssh-socket` configuration.

## 3.3.4 (2018-03-22)

* [Bugfix] Attach --volumes flag to `rm` command, not `provision`
Expand Down
6 changes: 6 additions & 0 deletions crane/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ type container struct {
RawRm bool `json:"rm" yaml:"rm"`
RawSecurityOpt []string `json:"security-opt" yaml:"security-opt"`
RawSecurity_Opt []string `json:"security_opt" yaml:"security_opt"`
ShareSshSocket bool `json:"share-ssh-socket" yaml:"share-ssh-socket"`
RawShmSize string `json:"shm-size" yaml:"shm-size"`
RawShm_Size string `json:"shm_size" yaml:"shm_size"`
SigProxy OptBool `json:"sig-proxy" yaml:"sig-proxy"`
Expand Down Expand Up @@ -1297,6 +1298,11 @@ func (c *container) createArgs(cmds []string) []string {
for _, securityOpt := range c.SecurityOpt() {
args = append(args, "--security-opt", securityOpt)
}
// Share SSH socket
if c.ShareSshSocket {
args = append(args, "--volume", "$SSH_AUTH_SOCK:/ssh-socket")
args = append(args, "--env", "SSH_AUTH_SOCK=/ssh-socket")
}
// ShmSize
if len(c.ShmSize()) > 0 {
args = append(args, "--shm-size", c.ShmSize())
Expand Down

0 comments on commit 5f90aef

Please sign in to comment.