Journal

Raw Notes

Docker - Containers share kernals - Cant run windows on a Linux host via Docker due to kernal - Docker Commands - Commands - docker ps → Shows all running containers - docker ps -a→ Shows all running and stopped containers - docker stop <container name or id> - docker rm → Removes a container permanently but keeps the image - docker images Show all docker images - docker rmi <image name> remove docker image - docker pull <image name> pulls the docker image from the hub - docker run ubuntu sleep 5 → runs a container and gives it the command to sleep for 5 seconds - docker exec <container name> <command> → will make a currently running container execute a command - Attached vs Detached - Attached means your console is now the console of the container - Detached means its running self contained and your console is your underlining console. - docker run → Will make you default attached - docker run -d → will let you run detached - docker attach <container id>→ Allows you to attach to a currently running container. - Command - docker run -d --name webapp nginx:1.14-alpine → Run a detached container based on the nginx alpine container and name it webapp