Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexprivalov/e124a3d0de655f6bb82b21e02cd982e0 to your computer and use it in GitHub Desktop.
Save alexprivalov/e124a3d0de655f6bb82b21e02cd982e0 to your computer and use it in GitHub Desktop.
docker staff
DOCKER
docker run -t -i ubuntu /bin/bash
docker run -t -v /home/alex/local_work/SDK-16.4-work/:/broadcom_arm -i ubuntu /bin/bash
docker rm `docker ps -aq` - remove all stopped containers
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
docker start -a -i $container_id - run last commant in exited container
=========RUN stopped/exited container ===========
http://stackoverflow.com/a/39329138
docker start $container_id
docker exec -it $container_id bash
docker commit $container_id $img_name
=========docker registry ===========
http://blog.pridybailo.com/docker-registry/
How to delete image from registry: http://stackoverflow.com/a/40293994:
1. Login to the container
docker exec -it registry sh
2. Define variables matching your container and container version:
export NAME="google/cadvisor"
export VERSION="v0.24.1"
3. Move to the the registry directory:
cd /var/lib/registry/docker/registry/v2
4. Delete files related to your hash:
find . | grep `ls ./repositories/$NAME/_manifests/tags/$VERSION/index/sha256`| xargs rm -rf $1
5. Delete manifests:
rm -rf ./repositories/$NAME/_manifests/tags/$VERSION
6. Logout
exit
7. Run the GC:
docker exec -it registry bin/registry garbage-collect /etc/docker/registry/config.yml
If all was done properly some information about deleted blobs is shown.
How to push docker image into local registry:
docker tag img_name 192.168.1.108:5000/img_name
docker push 192.168.1.108:5000/img_name
curl -X GET http://192.168.1.108:5000/v2/_catalog
curl -X GET http://192.168.1.108:5000/v2/broadcom/mag324/tags/list
curl -X GET http://192.168.1.108:5000/v2/broadcom/mag351/tags/list
https://github.com/mayflower/docker-ls
docker-ls repositories --registry http://192.168.1.108:5000 --level 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment