I have used following Docker file and you can see the JAVA instation command is there and respective env variable is there but still I am seeing errors in the pipeline. Please find attached YAML file and logs. Please suggest, Thank you
FROM alpine:latest
ENV TARGETARCH="linux-musl-x64"
# Another option:
# FROM arm64v8/alpine
# ENV TARGETARCH="linux-musl-arm64"
RUN apk update && apk upgrade
# Installing OpenJDK 11 and other required packages
RUN apk add --no-cache bash curl git icu-libs jq openjdk17-jre
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
ENV PATH="$JAVA_HOME/bin:$PATH"
# Verify Java installation
RUN java -version
WORKDIR /azp/
COPY ./start.sh ./
RUN chmod +x ./start.sh
RUN adduser -D agent
RUN chown agent ./
USER agent
# Another option is to run the agent as root.
# ENV AGENT_ALLOW_RUNASROOT="true"
ENTRYPOINT [ "./start.sh" ]
YAML pipeline:
trigger:
- none
# pool:
# vmImage: 'ubuntu-latest'
pool:
name: Default
demands:
- agent.name -equals Cagent8
variables:
mend: true
parameters:
- name: MendScan
type: string
default: false
jobs:
- job: BuildAndPublish
displayName: 'Build and Publish'
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: 'Use .NET 6'
inputs:
version: '6.x'
- task: DotNetCoreCLI@2
displayName: '.NET Restore'
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
- template: templates/sonarcloudprepare.yaml
- task: DotNetCoreCLI@2
displayName: '.NET Build'
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '--configuration Release'
- template: templates/sonarcloudbuildPublish.yaml
- task: DotNetCoreCLI@2
displayName: '.NET Publish'
inputs:
command: 'publish'
projects: '**/*.csproj'
arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)'
# - task: WhiteSource@21
# inputs:
# cwd: '$(System.DefaultWorkingDirectory)'
# projectName: 'webstore'
- template: templates/mendbolt.yaml
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'webstore'
publishLocation: 'pipeline'
# trigger:
# - none
# pool:
# name: Default
# demands:
# - agent.name -equals CAgent
# steps:
# - script: echo Hello, world!
# displayName: 'Run a one-line script'
# - script: |
# echo Add other tasks to build, test, and deploy your project.
# echo See https://aka.ms/yaml
# displayName: 'Run a multi-line script'
logs:
logs_1677.zip (99.0 KB)