Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 04ceff1

Browse files
authored
Merge pull request #127 from salmccarty/master
[Hacktoberfest] Add and Update useful Docker commands
2 parents b813161 + 364d2af commit 04ceff1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

source/snippets/docker/index.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,25 @@ docker image rm <image hash> //only first 3 characters of hash code is enough fo
107107
Docker containers
108108
```bash
109109
// list all containers online/offline
110-
111110
docker ps -a
112111
docker container ls -a
113-
// remove/stop/kill a certain container
114112

113+
// remove/stop/kill a certain container
115114
docker kill rm <container hash>
116-
```
117-
//coming out of container without exiting it: ctrl+P+Q
115+
116+
//coming out of container without exiting it
117+
ctrl+P+Q
118118

119119
//searching docker image on docker hub
120120
docker search <<image_name>>
121121
122122
//tagging local image with another name
123123
docker tag <<old_image_name>> <<new_image_name>>
124+
125+
//"SSH" into a running container
126+
docker exec -it <<container_name>> /bin/bash
127+
128+
//Execute arbitrary command in container
129+
docker exec -it <<container_name>> <<command>>
130+
131+
```

0 commit comments

Comments
 (0)