Skip to content

Commit 56bba70

Browse files
committed
docker exec the hard way
1 parent 8f07293 commit 56bba70

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docker/docker_exec_the_hard_way.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## `docker exec` the hard way
2+
3+
- Using tool `nsenter` we can enter any namespace.
4+
- Install `nsenter` instreuctions [here](https://github.com/jpetazzo/nsenter#how-do-i-install-nsenter-with-this).
5+
- Find `pid` of a running process:
6+
7+
```bash
8+
docker inspect --format {{.State.Pid}} <container_name or container_id>
9+
```
10+
11+
- Use `nsenter`
12+
13+
```bash
14+
sudo nsenter --target <container pid> --uts --pid --net --mount --ipc
15+
```
16+
17+
18+
### Ref:
19+
20+
- Video: https://www.youtube.com/watch?v=qRxzrJwSW_4
21+
- nsenter repo: https://github.com/jpetazzo/nsenter
22+
- nsenter docs: http://man7.org/linux/man-pages/man1/nsenter.1.html

editor/intellij/shortcuts.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Comment/Uncomment out with block comment, a line or selected block.
6464

6565
Move line or selection up/down.
6666

67+
- `Alt + cursor right/left`
68+
69+
Switch tabs of open files.
70+
6771

6872
## Notes and Tips
6973

0 commit comments

Comments
 (0)