Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joydeep100/dockerlearn
Learning docker, Docker command reference.
https://github.com/joydeep100/dockerlearn
Last synced: about 1 month ago
JSON representation
Learning docker, Docker command reference.
- Host: GitHub
- URL: https://github.com/joydeep100/dockerlearn
- Owner: joydeep100
- Created: 2020-03-19T10:54:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-25T14:45:24.000Z (over 4 years ago)
- Last Synced: 2024-11-19T19:16:47.942Z (about 1 month ago)
- Language: Dockerfile
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Docker Image & Container definition
Docker Image is a set of files which has no state, whereas Docker Container is the instantiation of Docker Image. In other words, Docker Container is the run time instance of images.## Images
- docker images //List all images
- docker rmi -f //To untag and remove an image
## Process
- docker run //run an instance
- docker run -it //run in interactive mode
- docker run --name //give a custom name to a running container or image process
- docker run -it //you can override the default command, i.e. CMD as in Dockerfile
- docker run -d //run detached
- docker run -p : //port mapping
- docker run --rm //will ensure the contaier related files are removed from docker daemon when the process stops, a practical way to see this is 'docker ps -a' with this flag included you can see there will be no trace here once the container is stopped
- docker exec -it //to get access to the running container
ex. ```docker exec -it efe1f0ab1991 bash```
- docker attach //to attach to a detached & running container
## Volumes
- docker run -v : //volume mapping - use absolute and existing paths(in client node)
ex. ```docker run -v $(pwd):/app```
ex. ```docker run -v /app/src``` //it means do not touch this path in the target container## Build
- docker build . //Ensure Dockerfile is present, '.' is the context. which means all path in local are relative to this path
- docker build -f