docker notes update

master
Tudor Stanciu 2021-06-25 19:13:25 +03:00
parent 22d96b69f1
commit 8c8aa4b9ed
1 changed files with 8 additions and 9 deletions

View File

@ -4,36 +4,35 @@ Docker commands:
Create image:
--from solution folder:
docker image build -t "reverse-proxy-frontend:1.0.1" .
docker image build -t "reverse-proxy-frontend:1.0.2" .
Run image:
docker run -p 5055:80 -it reverse-proxy-frontend:1.0.1
docker run -p 5055:80 -it reverse-proxy-frontend:1.0.2
Push image to registry:
--tag image
docker tag reverse-proxy-frontend:1.0.1 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.1
docker tag reverse-proxy-frontend:1.0.2 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
--login to registry
docker login --username=admin --password="***REMOVED***" alpine-nexus:8500
--push image
docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.1
docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
Pull image from registry
--login to registry
--pull image
docker pull alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.1
docker pull alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
Stop old container
docker stop reverse-proxy-frontend
docker rm reverse-proxy-frontend
docker stop reverse-proxy-frontend && docker rm reverse-proxy-frontend
Run container in prod env
docker run -d --name reverse-proxy-frontend --restart=always -p 5005:80 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.1
docker run -d --name reverse-proxy-frontend --restart=always -p 5005:80 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
Remove old image
docker rmi alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.0
docker rmi alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.1
Get container logs
docker logs reverse-proxy-frontend