Created
August 21, 2017 19:52
-
-
Save johnpapa/5b77c5d6328f00f5d4afb8b1e70cf722 to your computer and use it in GitHub Desktop.
Docker with angular and node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clone the code | |
git clone | |
# build the docker image locally | |
docker build -t angular-cosmosdb-app . | |
# show the image | |
docker images | |
# run it locally | |
docker run -d -p 8080:80 angular-cosmosdb-app | |
# Open the browser | |
http://localhost:8080 | |
# create a resource group | |
az group create --name aci-group --location eastus | |
# create the container registry in azure | |
az acr create --resource-group aci-group --name myaciregistry --sku Basic --admin-enabled true | |
# Show the Azure CR login Server | |
az acr show --name myaciregistry --query loginServer | |
# Show the Azure CR password | |
az acr credential show --name myaciregistry --query "passwords[0].value" | |
# Login to the Azure CR | |
docker login --username=myaciregistry --password=<acrPassword> myaciregistry.azurecr.io | |
# show the image again | |
docker images | |
# tag the local docker image | |
docker tag angular-cosmosdb-app myaciregistry.azurecr.io/angular-cosmosdb-app:v1 | |
# show the image again. name should be changed | |
docker images | |
# push the docker image to the Azure CR | |
docker push myaciregistry.azurecr.io/angular-cosmosdb-app:v1 | |
# show that it got to the Azure CR | |
az acr repository list --name myaciregistry --username myaciregistry --password <acrPassword> --output table | |
# create the container from the image in Azure CR | |
az container create --name angular-cosmosdb-app --image myaciregistry.azurecr.io/angular-cosmosdb-app:v1 --cpu 1 --memory 1 --registry-login-server myaciregistry.azurecr.io --registry-username myaciregistry --registry-password <acrPassword> --ip-address public -g aci-group | |
# check when it is ready | |
az container show --name angular-cosmosdb-app --resource-group aci-group --query state | |
# Show the IP address | |
az container show --name angular-cosmosdb-app --resource-group aci-group --query ipAddress.ip | |
# open it in the browser | |
http:// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment