Update Docker Doc

This commit is contained in:
2024-09-18 00:20:52 +03:30
parent fdd6f187d6
commit 71186dbaa8
3 changed files with 191 additions and 1 deletions

View File

@@ -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