docker notes update

master
Tudor Stanciu 2021-06-09 19:41:40 +03:00
parent d635313907
commit 2451b8ed10
1 changed files with 14 additions and 9 deletions

View File

@ -3,32 +3,37 @@
Create image:
--from solution folder:
docker image build -t "network-resurrector-api:1.0.0" -f "src/api/NetworkResurrector.Api/Dockerfile" .
docker image build -t "network-resurrector-api:1.0.1" -f "src/api/NetworkResurrector.Api/Dockerfile" .
Run image:
docker run -p 5053:80 -it network-resurrector-api:1.0.0
docker run -p 5053:80 -it network-resurrector-api:1.0.1
Push image to registry:
--tag image
docker tag network-resurrector-api:1.0.0 alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.0
docker tag network-resurrector-api:1.0.1 alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.1
--login to registry
docker login --username=admin --password="***REMOVED***" alpine-nexus:8500
--push image
docker push alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.0
docker push alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.1
Pull image from registry
--login to registry
--pull image
docker pull alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.0
docker pull alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.1
Stop old container
docker stop network-resurrector-api
docker rm network-resurrector-api
Run container in prod env
docker run -d --name network-resurrector-api --restart=always -p 5008:80 alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.0
docker run -d --name network-resurrector-api --restart=always -p 5008:80 alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.1
Remove old image
docker rmi alpine-nexus:8500/network-resurrector/network-resurrector-api:1.0.0
Rename container
docker rename <container_id> network-resurrector-api
#######################################################################################################################################################
Docker container last version: 1.0.0
Docker container last version: 1.0.1
##############################################################################################