@@ -39,6 +39,7 @@ type ClientConfig struct {
3939 Command []string `json:"command",omitempty`
4040 User string `json:"user",omitempty`
4141 Keys []string `json:"keys",omitempty`
42+ EntryPoint string `json:"entrypoint",omitempty`
4243}
4344
4445// NewClient initializes a new client
@@ -165,7 +166,11 @@ func (c *Client) HandleChannelRequests(channel ssh.Channel, requests <-chan *ssh
165166 // Opening Docker process
166167 if existingContainer != "" {
167168 // Attaching to an existing container
168- args := []string {"exec" , "-it" , existingContainer , c .Server .DefaultShell }
169+ shell := c .Server .DefaultShell
170+ if c .Config .EntryPoint != "" {
171+ shell = c .Config .EntryPoint
172+ }
173+ args := []string {"exec" , "-it" , existingContainer , shell }
169174 logrus .Debugf ("Executing 'docker %s'" , strings .Join (args , " " ))
170175 cmd = exec .Command ("docker" , args ... )
171176 cmd .Env = c .Config .Env .List ()
@@ -177,6 +182,9 @@ func (c *Client) HandleChannelRequests(channel ssh.Channel, requests <-chan *ssh
177182 if c .Config .User != "" {
178183 args = append (args , "-u" , c .Config .User )
179184 }
185+ if c .Config .EntryPoint != "" {
186+ args = append (args , "--entrypoint" , c .Config .EntryPoint )
187+ }
180188 args = append (args , c .Config .ImageName )
181189 if c .Config .Command != nil {
182190 args = append (args , c .Config .Command ... )
0 commit comments