Table of Contents
- Install
- Uninstall
- Uninstall from GUI
- Uninstall from command
- Command
- Docker run
- Others
- Dockerfile
- Container Link
Docker is the world’s leading software containerization platform
Docker Official Site
Docker Hub: search images from this site
Install
Go to Official Site and click download.
Uninstall
Uninstall from GUI
Choose –> Preferences from the menu bar, then click Uninstall / Reset on the Preferences dialog.
Uninstall from command
1 2 3
| $ /Applications/Docker.app/Contents/MacOS/Docker --uninstall Docker is running, exiting... Docker uninstalled successfully. You can move the Docker application to the trash.
|
Command
Docker run
- -d #run in background(demen)
- -p 80:5000 #map host 80 port to container 5000 port
- -t -i #execute interactive terminal
- –name
1 2 3 4
| docker run <userID>/<imageName> <command> <command parameter> docker run -d -p 80:5000 training/webapp python app.py docker run -t -i ubuntu:14.04 /bin/bash docker run -d -P --name web training/webapp python app.py
|
Others
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| docker pull <image> docker inspect <container ID> docker ps docker ps -a docker stop <container name> docker rm -f <container name>|<container id> docker images docker rmi <imageID>|<imageName> docker build -t <userID>/<imageName> ./ docker tag <imageID> <userID>/<imageName>:latest docker logs -f <container ID> docker login docker push <userID>/<imageName>
|
Dockerfile
1 2 3 4 5
| FROM docker/whalesay:latest RUN apt-get -y update && apt-get install -y fortunes ENV POSTGRES_USER faceblock CMD /usr/games/fortune -a | cowsay
|
Container Link
1 2
| docker run -d --name db training/postgres docker run -d -P --name web --link db:db training/webapp python app.py
|