Docker production and operation

docker build -t $1:latest -f ${DOCKERFILE} --network host.
#Mirror making docker tag $1:latest host:5000/${NAME}:${TAG}
docker push host:5000/$1:$2 #Upload Warehouse
docker rmi -f $1:latest
docker rmi -f host:5000/$1:$2

#!/bin/bash
docker image pull host:5000/$1:$2
#Pull the image docker container stop $1
#Stop the container docker rm -f $1
#Delete the container docker rmi -f $1:latest
#Delete the image docker tag host:5000 /$1:$2 $1:latest
#Change label docker rmi -f host:5000/$1:$2
docker run -d -p ${PORT}:${PORT} -e ENV=prod --restart=always --name= $1 $1:latest #Run mirror

docker images #View the mirror
docker ps #View the container
docker logs --since="2020-02-30" ${NAME}
#View the log docker exec -it ${NAME} /bin/bash
#Enter the container docker inspect ${NAME } #View metadata

docker save -o ./file.tar ${name}:${tag}
#Save the image docker load -i ./file.tar #Load the image

docker image prune -a -f #Clean up the image

curl http://host:5000/v2/_catalog #View warehouse mirror
curl http://host:5000/v2/${NAME}/tags/list
#View mirror tag docker pull registry
#Install warehouse docker run -d- v /edc/images/registry:/var/lib/registry -p 5000:5000 --restart=always --name dk-registry registry #Start the warehouse

Guess you like

Origin blog.csdn.net/slwsss/article/details/111084735
Recommended