Difference between revisions of "Docker"
From Alessandro's Wiki
(Created page with "==docker== === Kubernetes === Details about all nodes: kubectl describe nodes Start container testing parameters kubectl apply --validate -f mypod.yaml Save pod configuration to file kubectl get pods/mypod -o yaml > mypod.yaml Show running pods IP address kubectl get pods -l app=<app name> -o go-template='{{range .items}}{{.status.podIP}}{{"\n"}}{{end}}' Exposes the service to the net kubectl expose deployment <app name> --port=80 --target-port=9376 Get the servic...") |
(→docker) |
||
| Line 1: | Line 1: | ||
==docker== | ==docker== | ||
* list loaded images | |||
docker images | |||
* pull debian image from pub repo | |||
docker image pull debian:bookworm | |||
* stop a container | |||
'''data is deleted if volume non persistent!''' | |||
docker container stop | |||
* get container status | |||
docker top | |||
=== Kubernetes | * load an image from file | ||
docker load -i asim-rabbitmq.1.0.0.tar.gz | |||
* run a container with a port map | |||
docker run -d --name container-name -p 5678:5678 container-name:1.0.0 | |||
* get container logs | |||
docker logs <container ID> | |||
* execute a command in the container and print output to stdout | |||
docker exec <container ID> <command> | |||
=== Permission denided ...sock === | |||
sudo setfacl --modify user:devuser:rw /var/run/docker.sock | |||
== Kubernetes == | |||
Details about all nodes: | Details about all nodes: | ||
kubectl describe nodes | kubectl describe nodes | ||
Revision as of 10:49, 15 January 2025
docker
- list loaded images
docker images
- pull debian image from pub repo
docker image pull debian:bookworm
- stop a container
data is deleted if volume non persistent!
docker container stop
- get container status
docker top
- load an image from file
docker load -i asim-rabbitmq.1.0.0.tar.gz
- run a container with a port map
docker run -d --name container-name -p 5678:5678 container-name:1.0.0
- get container logs
docker logs <container ID>
- execute a command in the container and print output to stdout
docker exec <container ID> <command>
Permission denided ...sock
sudo setfacl --modify user:devuser:rw /var/run/docker.sock
Kubernetes
Details about all nodes:
kubectl describe nodes
Start container testing parameters
kubectl apply --validate -f mypod.yaml
Save pod configuration to file
kubectl get pods/mypod -o yaml > mypod.yaml
Show running pods IP address
kubectl get pods -l app=<app name> -o go-template='Template:Range .itemsTemplate:.status.podIPTemplate:"\n"Template:End'
Exposes the service to the net
kubectl expose deployment <app name> --port=80 --target-port=9376
Get the services for an app
kubectl get svc <app name>