updated notes
This commit is contained in:
+35
-1
@@ -959,9 +959,43 @@ podman ps # Display the running containers
|
||||
podman logs mynginx # Display the logs of the mynginx container
|
||||
podman exec -it mynginx bash # Execute a command in the mynginx container
|
||||
|
||||
podman stop mynginx # Stop the mynginx container
|
||||
podman start mynginx # Start the mynginx container
|
||||
podman stop mynginx # Stop the mynginx container
|
||||
podman rm mynginx # Remove the mynginx container
|
||||
|
||||
podman rmi nginx:latest # Remove the nginx image
|
||||
```
|
||||
|
||||
### Building Custom Images with Podman
|
||||
```bash
|
||||
FROM fedora:latest
|
||||
|
||||
RUN dnf install -y vim
|
||||
|
||||
COPY welcome.txt /root/welcome.txt
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
```
|
||||
|
||||
> Note: You can build the image with podman build -t myimage .
|
||||
|
||||
### Running Containers with Podman
|
||||
```bash
|
||||
### build the image
|
||||
podman build -t myimage -f Containerfile .
|
||||
|
||||
### run the container
|
||||
podman run -it --name mycustomcontainer myimage
|
||||
```
|
||||
|
||||
### Persistent Storage
|
||||
```bash
|
||||
### create a volume
|
||||
podman volume create myvolume
|
||||
|
||||
### list the volumes
|
||||
podman volume ls
|
||||
|
||||
### run the container with the volume
|
||||
podman run --name mywebserver -d -p 8080:80 -v myvolume:/var/www/html:Z nginx
|
||||
```
|
||||
Reference in New Issue
Block a user