Ubuntu – Docker History

安裝 docker (new)

安裝 docker apt key 保持軟體新版本


<span class="hljs-attr">curl</span> <span class="hljs-string">-fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -</span>

<span class="hljs-attr">sudo</span> <span class="hljs-string">apt-get install -y lrzsz docker.io docker-compose</span>

check docker logs

$sudo docker logs --tail 50 -f acm_django

Delete all containers:
sudo docker ps -a -q | xargs -n 1 -I {} sudo docker rm {}
sudo docker ps -a -q | xargs -n 1 -I {} sudo docker stop {} && sudo docker ps -a -q | xargs -n 1 -I {} sudo docker rm {}
Delete all un-tagged (or intermediate) images:
sudo docker rmi $( sudo docker images | grep '<none>' | tr -s ' ' | cut -d ' ' -f 3)
sudo docker rmi $( sudo docker images | grep 'stg' | tr -s ' ' | cut -d ' ' -f 3)

sudo docker rmi $( sudo docker images | grep 'production' | tr -s ' ' | cut -d ' ' -f 3)



check version
[email protected]:~$ sudo docker exec sfm cat GIT_SHA
bcc3b9c87893a7812f55c8890fb1a5b7a8b25fef 2017-09-27 (HEAD, tag: v3.0.5, origin/develop-rolling-update, develop-rolling-update)
[email protected]:~$

綀習

$sudo docker ps
 
$sudo docker ps -a
 
$sudo docker images
 
$sudo docker inspect mayer/foo:latest (Check image context)
 
$sudo docker stop 10638871eafb(CONTAINER ID)
 
$sudo docker rm -f $(docker ps -a -q)
 
$sudo docker rmi $(docker images -a -q)
docker inspect --format='{{.LogPath}}' acm_nginx

參考連結: https://dzone.com/articles/docker-bulk-remove-images-and