Install JDK 8, then run Jenkins from the war:
|
|
Open port 8080, use the initial admin password from .../secrets/initialAdminPassword
, install suggested plugins, create admin.
We’ll return to Jenkins after preparing Docker builds for our .NET Core app.
Dockerfile for .NET Core
In your project folder, Dockerfile
:
|
|
Optional local build/run script
|
|
Jenkins Job
- New item → Freestyle project
- Source Code Management → Git (configure credentials/keys as needed)
- Build → “Execute shell” with either the local build script above, or a remote
ssh user@host '~/start_XXX.sh'
.
Better builds with Aliyun Container Registry (ACR)
Instead of building on Jenkins/host, connect your repo to Aliyun Container Registry (ACR) and enable “auto build on code changes”. ACR will build and host your images.
Then, use a webhook from ACR to trigger Jenkins after a successful build.
Generic Webhook Trigger
Install the “Generic Webhook Trigger” plugin. The trigger URL looks like:
|
|
Set the same token under the job’s “Trigger builds remotely”. Disable CSRF protection if needed for webhook calls.
Flow:
repo change → ACR auto build → ACR webhook → Jenkins job → deployment script pulls and runs the new image.
Deployment step becomes:
|
|
Summary
- Stand up Jenkins. 2) Add Dockerfile. 3) Use ACR to build images. 4) Use ACR webhook → Jenkins to deploy. 5) Works for other stacks too — just change the Dockerfile.