Docker Application Template for deploying eShopOnWeb onto Azure Kubernetes Service.
- You need Docker Desktop Enterprise which has the Application Templates feature.
The demo is a Linux app, so on Windows you need to use Linux container mode
- You need a Docker Hub account, so the pipeline can push images.
If you've set your account to create private repos on push, make sure you have capacity for another repo
- Create a Service Principal in Azure. You can use the Azure CLI or Azure Cloud Shell:
az ad sp create-for-rbac --name http://eshoponweb
The output contains all the details you'll need to save as GitHub secrets
- Your GitHub account needs to be approved for GitHub Actions (currently in beta). Then create an empty repo and set the following secrets (under Settings...Secrets):
AZURE_SP_APP_ID
- Service Principal application IDAZURE_SP_NAME
- Service Principal nameAZURE_SP_PASSWORD
- Service Principal passwordAZURE_SP_TENANT
- Service Principal tenantAZURE_SQL_SERVER_NAME
- Name of the SQL Server instanceAZURE_SQL_PASSWORD
- Password for SQL ServerDOCKER_HUB_USERNAME
- Docker Hub usernameDOCKER_HUB_ACCESS_TOKEN
- Docker Hub Personal Access Token
Update your Docker Application Template config in ~/.docker/application-template/preferences.yaml
to include the template library at https://raw.githubusercontent.com/dockersamples/eshoponweb-template/master/eshoponweb-library.yaml
.
This example includes the local demo libraries and the main Docker library:
apiVersion: v1alpha1
disableFeedback: false
kind: Preferences
repositories:
- name: eshoponweb-library
url: https://raw.githubusercontent.com/dockersamples/eshoponweb-template/master/eshoponweb-library.yaml
- name: library
url: https://docker-application-template.s3.amazonaws.com/production/v0.1.5/library.yaml
-
Run Application Designer (open the Docker whale menu from the taskbar and click Design new application...)
-
Select New Application... Choose a template (if you're running on Windows 10 select Linux) You should see the eShop on Web app listed with all the standard templates:
- Select the template and add the settings for your application:
-
You need to provide:
-
Your GitHub username and the name of the repository to use. This needs to be the GitHub repo you created with your secrets.
-
The name for your Azure resource group. The deployment will create this group if it doesn't exist, so you can use any name.
-
The name for your AKS cluster. This gets created for you so you can use any name.
-
-
Click Continue, give your app a name and click Scaffold:
- Click Run Application. Docker Desktop Enterprise will build and run the app locally:
- Click Open in Visual Studio Code to see the source code the template generated.
Now browse to the
README.md
doc in theeshop-web
folder to see how to deploy the app to Azure.
Delete the resource group you created.
Delete the Service Principal:
az ad sp delete --id http://eshoponweb
The demo app is a modified version of eShopOnWeb.