Sample asp.net core web application - alpine
In this i tried below
- Read application configuration from appsettings.json
- read variable from environment
- Docker multistage build
- Using alpine as base image
- Using config map to inject environment variables
- Using secrets
- Use helm
- use helm to deploy in differnt namespace
docker build -f Dockerfile.alpine-x64 -t alpinecore:1.0 .
docker build -f Dockerfile.alpine-x64 -t alpinecore:1.0 . && docker run -it -p 8081:80 alpinecore:1.0
docker exec -it dedd102f87154 '/bin/sh'
docker stop $(docker ps --all --format "{{.Names}}")
docker run -d -p 8081:80 alpinecore:1.0
docker build --build-arg rabbitmq=localhost -f Dockerfile.alpine-x64 -t alpinecore:1.0 .
-
Build the image --> docker build -f Dockerfile.alpine-x64 -t alpinecore:1.0 .
-
Tag image --> docker tag alpineaspnetcore:1.0 bhoobal/alpineaspnetcore:1.0
-
docker login --> docker login
-
Push the image to repo --> docker push bhoobal/alpineaspnetcore:1.0
git init git add . git commit git push git remote add origin [email protected]:bhoobal/Sample_aspcore_webapplication git push origin git push --set-upstream origin master
I am using minikube
$ minikube start
$ minikune ip
$ minikube status
$ kubect proxy -- to start dashboard
$ kubectl apply -f webappdeployment.yaml
$ kubectl expose deployment webapplication-deployment --type=NodePort --port 80 --target-port 80
You need to make sure pods and endpoints are exposed in services
$ kubectl describe services
$ kubectl apply -f configmapexample.yaml
$ kubectl apply -f webappdeployment.yaml