Refer this url to get official cheat sheet for docker commands. Below are some of frequently used commands by me
Find all docker images installed on system
docker images
Find container id of currently running dockers
docker ps
Stop or kill running container
docker kill <container id from above command>
Install new image in Docker
docker pull <image name>
Remove Docker Images
First run below command to see Image names and Image Id
docker images
get docker image Id from above command and then run below command to delete image
docker image rm <image Id>
or
docker image rm <image id> -f
Remove unused Volumes
If you have huge space used by Docker, it may be because so many zombie volumes, run below command to remove unused volumes
docker volume prune
Jenkins docker commands
This is the official jenkins image for docker. To install docker, as per this website, run below command
docker pull jenkins/jenkins:lts
# then below command to run Jenkins image in docker
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
#Above image will run jenkins on http://localhost:8080
Pgadmin docker commands
Pgadmin is widely postgresql client
Install PostgreSQL
docker pull dpage/pgadmin4
Start PostgreSQL with default username and password
docker run -p 80:80 \
-e "PGADMIN_DEFAULT_EMAIL=user@domain.com" \
-e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" \
-d dpage/pgadmin4
Phpmyadmin docker commands
phpmyadmin is popular mySQL client to access local or cloud based MySQL Servers
Install or pull phpmyadmin docker
docker pull phpmyadmin/phpmyadmin
Run phpmyadmin docker
docker run --name myadmin -d -e PMA_ARBITRARY=1 -p 8080:80 phpmyadmin/phpmyadmin PMA_PORT=3203
Leave a Reply