Update Docker Doc
This commit is contained in:
@@ -101,6 +101,14 @@ docker run -dit nginx
|
||||
```
|
||||
- **`docker run -dit`**: Runs a container in detached mode (background).
|
||||
|
||||
```bash
|
||||
docker run -dit --restart=always nginx
|
||||
```
|
||||
|
||||
```bash
|
||||
docker run -dit --restart=always nginx
|
||||
```
|
||||
|
||||
```bash
|
||||
docker run -dit --name <container-name> nginx
|
||||
```
|
||||
@@ -136,6 +144,12 @@ docker logs -f
|
||||
```
|
||||
- **`docker logs -f`**: Streams logs of a container in real-time.
|
||||
|
||||
|
||||
```bash
|
||||
docker events
|
||||
```
|
||||
|
||||
|
||||
```bash
|
||||
docker exec -it <container-name>
|
||||
```
|
||||
@@ -189,6 +203,7 @@ docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-name>
|
||||
```bash
|
||||
docker cp <file_on_local> <container-name>:/<location>
|
||||
```
|
||||
`-A` : use for archive mode (keep permmision and )
|
||||
- **`docker cp <file_on_local> <container-name>:/<location>`**: Copies files from local machine to the container.
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user