23 lines
438 B
Go
23 lines
438 B
Go
package docker
|
|
|
|
import (
|
|
"github.com/docker/docker/api/types/container"
|
|
"github.com/gliderlabs/ssh"
|
|
)
|
|
|
|
func StartContainer(s ssh.Session) {
|
|
_, _, isTty := s.Pty()
|
|
|
|
cfg := &container.Config{
|
|
Image: "alpine:3.12",
|
|
Cmd: []string{"sh"},
|
|
Tty: isTty,
|
|
OpenStdin: true,
|
|
AttachStderr: true,
|
|
AttachStdin: true,
|
|
AttachStdout: true,
|
|
StdinOnce: true,
|
|
Volumes: make(map[string]struct{}),
|
|
}
|
|
}
|