Skip to content

Commit

Permalink
Share PIDs, UTS and Network namespaces in debugger container
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecruz91 committed Oct 26, 2022
1 parent 42cca84 commit c5fb9db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func createCopyContainer(ctx context.Context, debugImage, targetContainer, copyC
}
log.Printf("containerCmd: %+v", containerCmd)

target := "container:" + targetContainer
copyContainerCreateResp, err := cli.ContainerCreate(ctx, &container.Config{
Image: inspect.Image,
User: inspect.Config.User,
Expand All @@ -244,6 +245,9 @@ func createCopyContainer(ctx context.Context, debugImage, targetContainer, copyC
Binds: []string{
volume + ":" + "/.debugger",
},
NetworkMode: container.NetworkMode(target),
PidMode: container.PidMode(target),
UTSMode: container.UTSMode(target),
}, nil, nil, copyContainerName)
if err != nil {
return err
Expand Down

0 comments on commit c5fb9db

Please sign in to comment.