🐳 Set of Docker commands
docker pull <imageName>
docker run -d <imagename> sleep <time>
where -d
means run in background and <time>
is the miliseconds the container will be alive
docker exec <containerId> <command>
docker ps
docker images
docker inspect <containerId>
docker ps -a
docker stop <containerName>
docker stop <containerId>
docker rm <containerId>
docker rm <containerName>
docker rmi <imageName>
docker run -it <
docker run -p <hostPort:containerPort> <containerName>
docker build .
command will look for Dockerfile
file
docker build . -t <username/imageName>
docker login
docker push <imageName>
you have to be logged in
kubectl run hello-world --image=fiunchinho/codely-docker:latest --restart=Never --port=80 --dry-run -o yaml > pod.yml
where --dry-run
dosen't execute the command just "test" it.
kubectl create -f pod.yml
pod.yml
can be a local file or a remote file via http://....
kubectl get pods
kubectl describe pod hello-world
kubectl delete pod [pod name]