diff --git a/.github/workflows/openjdk-11-nanoserver.yml b/.github/workflows/openjdk-11-nanoserver.yml deleted file mode 100644 index 58a4106c..00000000 --- a/.github/workflows/openjdk-11-nanoserver.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: openjdk-11-nanoserver - -on: - push: - paths: - - "openjdk-11-nanoserver/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bats" - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - pull_request: - paths: - - "openjdk-11-nanoserver/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - -env: - DOCKER_PUSH: "true" - -jobs: - build: - uses: ./.github/workflows/_template_windows.yml - with: - directory: openjdk-11-nanoserver - secrets: inherit diff --git a/.github/workflows/openjdk-11-windowsservercore.yml b/.github/workflows/openjdk-11-windowsservercore.yml deleted file mode 100644 index 65e1450a..00000000 --- a/.github/workflows/openjdk-11-windowsservercore.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: openjdk-11-windowsservercore - -on: - push: - paths: - - "openjdk-11-windowsservercore/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bats" - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - pull_request: - paths: - - "openjdk-11-windowsservercore/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - -env: - DOCKER_PUSH: "true" - -jobs: - build: - uses: ./.github/workflows/_template_windows.yml - with: - directory: openjdk-11-windowsservercore - secrets: inherit diff --git a/.github/workflows/openjdk-8-nanoserver.yml b/.github/workflows/openjdk-8-nanoserver.yml deleted file mode 100644 index dd342c4f..00000000 --- a/.github/workflows/openjdk-8-nanoserver.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: openjdk-8-nanoserver - -on: - push: - paths: - - "openjdk-8-nanoserver/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bats" - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - pull_request: - paths: - - "openjdk-8-nanoserver/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - -env: - DOCKER_PUSH: "true" - -jobs: - build: - uses: ./.github/workflows/_template_windows.yml - with: - directory: openjdk-8-nanoserver - secrets: inherit diff --git a/.github/workflows/openjdk-8-windowsservercore.yml b/.github/workflows/openjdk-8-windowsservercore.yml deleted file mode 100644 index a147c5ab..00000000 --- a/.github/workflows/openjdk-8-windowsservercore.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: openjdk-8-windowsservercore - -on: - push: - paths: - - "openjdk-8-windowsservercore/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bats" - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - pull_request: - paths: - - "openjdk-8-windowsservercore/**" - - "tests/**" - - github-action.ps1 - - "!tests/*.bash" - - "!tests/Dockerfile" - - .github/workflows/_template_windows.yml - -env: - DOCKER_PUSH: "true" - -jobs: - build: - uses: ./.github/workflows/_template_windows.yml - with: - directory: openjdk-8-windowsservercore - secrets: inherit diff --git a/README.md b/README.md index ba21e694..67794f9f 100644 --- a/README.md +++ b/README.md @@ -94,10 +94,6 @@ Only under `csanchez/maven` and `ghcr.io/carlossg/maven`: See Docker Hub [`csanchez/maven`](https://hub.docker.com/r/csanchez/maven) for an updated list of tags -* ~~[openjdk-8-windowsservercore-1809](https://github.com/carlossg/docker-maven/blob/main/openjdk-8-windowsservercore/Dockerfile)~~ [(deprecated)](https://github.com/docker-library/openjdk?tab=readme-ov-file#deprecated) -* ~~[openjdk-8-nanoserver](https://github.com/carlossg/docker-maven/blob/main/openjdk-8-nanoserver/Dockerfile)~~ [(deprecated)](https://github.com/docker-library/openjdk?tab=readme-ov-file#deprecated) -* ~~[openjdk-11-windowsservercore-1809](https://github.com/carlossg/docker-maven/blob/main/openjdk-11-windowsservercore/Dockerfile)~~ [(deprecated)](https://github.com/docker-library/openjdk?tab=readme-ov-file#deprecated) -* ~~[openjdk-11-nanoserver](https://github.com/carlossg/docker-maven/blob/main/openjdk-11-nanoserver/Dockerfile)~~ [(deprecated)](https://github.com/docker-library/openjdk?tab=readme-ov-file#deprecated) * [amazoncorretto-8-windowsservercore-1809](https://github.com/carlossg/docker-maven/blob/main/amazoncorretto-8-windowsservercore/Dockerfile) * [amazoncorretto-11-windowsservercore-1809](https://github.com/carlossg/docker-maven/blob/main/amazoncorretto-11-windowsservercore/Dockerfile) * [amazoncorretto-17-windowsservercore-1809](https://github.com/carlossg/docker-maven/blob/main/amazoncorretto-17-windowsservercore/Dockerfile) diff --git a/common.sh b/common.sh index eb3b8216..32976820 100755 --- a/common.sh +++ b/common.sh @@ -8,10 +8,9 @@ latest='21' default_jdk=eclipse-temurin # All the JDKs and their 'latest' tags -parent_images=(openjdk eclipse-temurin ibmjava ibm-semeru amazoncorretto libericaopenjdk sapmachine graalvm-community oracle-graalvm) +parent_images=(eclipse-temurin ibmjava ibm-semeru amazoncorretto libericaopenjdk sapmachine graalvm-community oracle-graalvm) declare -A jdk_latest=( ["jdk"]="17" - ["openjdk"]="" ["eclipse-temurin"]=$latest ["ibmjava"]="8" ["ibm-semeru"]="" @@ -31,7 +30,7 @@ declare -A extra_tags=( ) # All the directories that have images -all_dirs=(openjdk-* eclipse-temurin-* ibmjava-* ibm-semeru-* amazoncorretto-* azulzulu-* libericaopenjdk-* microsoft-* sapmachine-* graalvm-community-* oracle-graalvm-*) +all_dirs=(eclipse-temurin-* ibmjava-* ibm-semeru-* amazoncorretto-* azulzulu-* libericaopenjdk-* microsoft-* sapmachine-* graalvm-community-* oracle-graalvm-*) ###################################################################################################################################### diff --git a/github-action.ps1 b/github-action.ps1 index 78417300..73f82096 100644 --- a/github-action.ps1 +++ b/github-action.ps1 @@ -21,7 +21,7 @@ Write-Host "Image: $dir" if(($dir.Contains('amazoncorretto')) -or ($dir.Contains('azulzulu'))) { $windowsDockerTag = 'ltsc2019' } -if(($dir.Contains('eclipse-temurin')) -or ($dir.Contains('openjdk'))) { +if($dir.Contains('eclipse-temurin')) { $windowsDockerTag = '1809' } diff --git a/openjdk-11-nanoserver/Dockerfile b/openjdk-11-nanoserver/Dockerfile deleted file mode 100644 index 4e289146..00000000 --- a/openjdk-11-nanoserver/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# escape=` -ARG JAVA_VERSION=11.0.6 -# we use the latest stable if nothing is passed -ARG POWERSHELL_VERSION= - -FROM openjdk:${JAVA_VERSION}-windowsservercore-1809 as openjdk - -FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 - -LABEL org.opencontainers.image.title="Apache Maven" -LABEL org.opencontainers.image.source=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.url=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.description="Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information." - -SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -USER ContainerAdministrator - -ENV JAVA_HOME=C:\openjdk-11 - -COPY --from=openjdk $JAVA_HOME $JAVA_HOME - -ENV ProgramFiles="C:\Program Files" -ENV WindowsPATH="C:\Windows\system32;C:\Windows" - -ARG USER_HOME_DIR="C:/Users/ContainerUser" -ARG MAVEN_VERSION=3.9.9 -ARG SHA=8beac8d11ef208f1e2a8df0682b9448a9a363d2ad13ca74af43705549e72e74c9378823bf689287801cbbfc2f6ea9596201d19ccacfdfb682ee8a2ff4c4418ba -ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries - -RUN Invoke-WebRequest -Uri ${env:BASE_URL}/apache-maven-${env:MAVEN_VERSION}-bin.zip -OutFile ${env:TEMP}/apache-maven.zip ; ` - if((Get-FileHash -Algorithm SHA512 -Path ${env:TEMP}/apache-maven.zip).Hash.ToLower() -ne ${env:SHA}) { exit 1 } ; ` - Expand-Archive -Path ${env:TEMP}/apache-maven.zip -Destination C:/ProgramData ; ` - Move-Item C:/ProgramData/apache-maven-${env:MAVEN_VERSION} C:/ProgramData/Maven ; ` - New-Item -ItemType Directory -Path C:/ProgramData/Maven/Reference | Out-Null ; ` - Remove-Item ${env:TEMP}/apache-maven.zip - -ENV MAVEN_HOME=C:/ProgramData/Maven -ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2" - -COPY mvn-entrypoint.ps1 C:/ProgramData/Maven/mvn-entrypoint.ps1 -COPY settings-docker.xml C:/ProgramData/Maven/Reference/settings-docker.xml - -USER ContainerUser - -ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;${MAVEN_HOME}\bin" - -ENTRYPOINT ["pwsh", "-f", "C:/ProgramData/Maven/mvn-entrypoint.ps1"] -CMD ["mvn"] diff --git a/openjdk-11-nanoserver/mvn-entrypoint.ps1 b/openjdk-11-nanoserver/mvn-entrypoint.ps1 deleted file mode 100644 index 13e3319b..00000000 --- a/openjdk-11-nanoserver/mvn-entrypoint.ps1 +++ /dev/null @@ -1,49 +0,0 @@ - -# Copy files from C:/ProgramData/Maven/Reference into ${MAVEN_CONFIG} -# So the initial ~/.m2 is set with expected content. -# Don't override, as this is just a reference setup - -function Copy-ReferenceFiles() { - $log = "${env:MAVEN_CONFIG}/copy_reference_file.log" - $ref = "C:/ProgramData/Maven/Reference" - - $repo = Join-Path $env:MAVEN_CONFIG 'repository' - - New-Item -Path $repo -ItemType Directory -Force | Out-Null - Write-Output $null > $log - if((Test-Path $repo) -and (Test-Path $log)) { - $count = (Get-ChildItem $repo | Measure-Object).Count - if($count -eq 0) { - # destination is empty... - Add-Content -Path $log -Value "--- Copying all files to ${env:MAVEN_CONFIG} at $(Get-Date)" - Copy-Item -Path "$ref\*" -Destination $env:MAVEN_CONFIG -Force -Recurse | Add-Content -Path $log - } else { - # destination is non-empty, copy file-by-file - Add-Content -Path $log -Value "--- Copying individual files to ${MAVEN_CONFIG} at $(Get-Date)" - Get-ChildItem -Path $ref -File | ForEach-Object { - Push-Location $ref - $rel = Resolve-Path -Path $($_.FullName) -Relative - Pop-Location - if(!(Test-Path (Join-Path $env:MAVEN_CONFIG $rel)) -or (Test-Path $('{0}.override' -f $_.FullName))) { - $dir = Join-Path $env:MAVEN_CONFIG $($rel.DirectoryName) - if(!(Test-Path $dir)) { - New-Item -Path $dir -ItemType Directory | Out-Null - } - Copy-Item -Path $_.FullName -Destination (Join-Path $env:MAVEN_CONFIG $rel) | Add-Content -Path $log - } - } - } - Add-Content -Path $log -Value "" - } else { - Write-Warning "Can not write to ${log}. Wrong volume permissions? Carrying on ..." - } -} - -Push-Location -StackName 'maven-entrypoint' -Copy-ReferenceFiles -Pop-Location -StackName 'maven-entrypoint' - -Remove-Item Env:\MAVEN_CONFIG - -Invoke-Expression "$args" -exit $lastExitCode diff --git a/openjdk-11-nanoserver/settings-docker.xml b/openjdk-11-nanoserver/settings-docker.xml deleted file mode 100644 index 9cd1a5ea..00000000 --- a/openjdk-11-nanoserver/settings-docker.xml +++ /dev/null @@ -1,6 +0,0 @@ - - C:\ProgramData\Maven\Reference\repository - diff --git a/openjdk-11-windowsservercore/Dockerfile b/openjdk-11-windowsservercore/Dockerfile deleted file mode 100644 index f0a26e59..00000000 --- a/openjdk-11-windowsservercore/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# escape=` -FROM openjdk:11-jdk-windowsservercore-1809 - -LABEL org.opencontainers.image.title="Apache Maven" -LABEL org.opencontainers.image.source=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.url=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.description="Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information." - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG USER_HOME_DIR="C:/Users/ContainerUser" -ARG MAVEN_VERSION=3.9.9 -ARG SHA=8beac8d11ef208f1e2a8df0682b9448a9a363d2ad13ca74af43705549e72e74c9378823bf689287801cbbfc2f6ea9596201d19ccacfdfb682ee8a2ff4c4418ba -ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries - -RUN Invoke-WebRequest -Uri ${env:BASE_URL}/apache-maven-${env:MAVEN_VERSION}-bin.zip -OutFile ${env:TEMP}/apache-maven.zip ; ` - if((Get-FileHash -Algorithm SHA512 -Path ${env:TEMP}/apache-maven.zip).Hash.ToLower() -ne ${env:SHA}) { exit 1 } ; ` - Expand-Archive -Path ${env:TEMP}/apache-maven.zip -Destination C:/ProgramData ; ` - Move-Item C:/ProgramData/apache-maven-${env:MAVEN_VERSION} C:/ProgramData/Maven ; ` - New-Item -ItemType Directory -Path C:/ProgramData/Maven/Reference | Out-Null ; ` - Remove-Item ${env:TEMP}/apache-maven.zip - -ENV MAVEN_HOME=C:/ProgramData/Maven -ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2" - -COPY mvn-entrypoint.ps1 C:/ProgramData/Maven/mvn-entrypoint.ps1 -COPY settings-docker.xml C:/ProgramData/Maven/Reference/settings-docker.xml - -RUN setx /M PATH $('{0};{1}' -f $env:PATH,'C:\ProgramData\Maven\bin') | Out-Null - -USER ContainerUser -ENV JAVA_HOME=${JAVA_HOME} - -ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Maven/mvn-entrypoint.ps1"] -CMD ["mvn"] diff --git a/openjdk-11-windowsservercore/mvn-entrypoint.ps1 b/openjdk-11-windowsservercore/mvn-entrypoint.ps1 deleted file mode 100644 index 13e3319b..00000000 --- a/openjdk-11-windowsservercore/mvn-entrypoint.ps1 +++ /dev/null @@ -1,49 +0,0 @@ - -# Copy files from C:/ProgramData/Maven/Reference into ${MAVEN_CONFIG} -# So the initial ~/.m2 is set with expected content. -# Don't override, as this is just a reference setup - -function Copy-ReferenceFiles() { - $log = "${env:MAVEN_CONFIG}/copy_reference_file.log" - $ref = "C:/ProgramData/Maven/Reference" - - $repo = Join-Path $env:MAVEN_CONFIG 'repository' - - New-Item -Path $repo -ItemType Directory -Force | Out-Null - Write-Output $null > $log - if((Test-Path $repo) -and (Test-Path $log)) { - $count = (Get-ChildItem $repo | Measure-Object).Count - if($count -eq 0) { - # destination is empty... - Add-Content -Path $log -Value "--- Copying all files to ${env:MAVEN_CONFIG} at $(Get-Date)" - Copy-Item -Path "$ref\*" -Destination $env:MAVEN_CONFIG -Force -Recurse | Add-Content -Path $log - } else { - # destination is non-empty, copy file-by-file - Add-Content -Path $log -Value "--- Copying individual files to ${MAVEN_CONFIG} at $(Get-Date)" - Get-ChildItem -Path $ref -File | ForEach-Object { - Push-Location $ref - $rel = Resolve-Path -Path $($_.FullName) -Relative - Pop-Location - if(!(Test-Path (Join-Path $env:MAVEN_CONFIG $rel)) -or (Test-Path $('{0}.override' -f $_.FullName))) { - $dir = Join-Path $env:MAVEN_CONFIG $($rel.DirectoryName) - if(!(Test-Path $dir)) { - New-Item -Path $dir -ItemType Directory | Out-Null - } - Copy-Item -Path $_.FullName -Destination (Join-Path $env:MAVEN_CONFIG $rel) | Add-Content -Path $log - } - } - } - Add-Content -Path $log -Value "" - } else { - Write-Warning "Can not write to ${log}. Wrong volume permissions? Carrying on ..." - } -} - -Push-Location -StackName 'maven-entrypoint' -Copy-ReferenceFiles -Pop-Location -StackName 'maven-entrypoint' - -Remove-Item Env:\MAVEN_CONFIG - -Invoke-Expression "$args" -exit $lastExitCode diff --git a/openjdk-11-windowsservercore/settings-docker.xml b/openjdk-11-windowsservercore/settings-docker.xml deleted file mode 100644 index 9cd1a5ea..00000000 --- a/openjdk-11-windowsservercore/settings-docker.xml +++ /dev/null @@ -1,6 +0,0 @@ - - C:\ProgramData\Maven\Reference\repository - diff --git a/openjdk-8-nanoserver/Dockerfile b/openjdk-8-nanoserver/Dockerfile deleted file mode 100644 index 9df591ef..00000000 --- a/openjdk-8-nanoserver/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# escape=` -ARG JAVA_VERSION=8u242 -# we use the latest stable if nothing is passed -ARG POWERSHELL_VERSION= - -FROM openjdk:${JAVA_VERSION}-windowsservercore-1809 as openjdk - -FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 - -LABEL org.opencontainers.image.title="Apache Maven" -LABEL org.opencontainers.image.source=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.url=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.description="Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information." - -SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -USER ContainerAdministrator - -ENV JAVA_HOME=C:\openjdk-8 - -COPY --from=openjdk $JAVA_HOME $JAVA_HOME - -ENV ProgramFiles="C:\Program Files" -ENV WindowsPATH="C:\Windows\system32;C:\Windows" - -ARG USER_HOME_DIR="C:/Users/ContainerUser" -ARG MAVEN_VERSION=3.9.9 -ARG SHA=8beac8d11ef208f1e2a8df0682b9448a9a363d2ad13ca74af43705549e72e74c9378823bf689287801cbbfc2f6ea9596201d19ccacfdfb682ee8a2ff4c4418ba -ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries - -RUN Invoke-WebRequest -Uri ${env:BASE_URL}/apache-maven-${env:MAVEN_VERSION}-bin.zip -OutFile ${env:TEMP}/apache-maven.zip ; ` - if((Get-FileHash -Algorithm SHA512 -Path ${env:TEMP}/apache-maven.zip).Hash.ToLower() -ne ${env:SHA}) { exit 1 } ; ` - Expand-Archive -Path ${env:TEMP}/apache-maven.zip -Destination C:/ProgramData ; ` - Move-Item C:/ProgramData/apache-maven-${env:MAVEN_VERSION} C:/ProgramData/Maven ; ` - New-Item -ItemType Directory -Path C:/ProgramData/Maven/Reference | Out-Null ; ` - Remove-Item ${env:TEMP}/apache-maven.zip - -ENV MAVEN_HOME=C:/ProgramData/Maven -ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2" - -COPY mvn-entrypoint.ps1 C:/ProgramData/Maven/mvn-entrypoint.ps1 -COPY settings-docker.xml C:/ProgramData/Maven/Reference/settings-docker.xml - -USER ContainerUser - -ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;${MAVEN_HOME}\bin" - -ENTRYPOINT ["pwsh", "-f", "C:/ProgramData/Maven/mvn-entrypoint.ps1"] -CMD ["mvn"] diff --git a/openjdk-8-nanoserver/mvn-entrypoint.ps1 b/openjdk-8-nanoserver/mvn-entrypoint.ps1 deleted file mode 100644 index 13e3319b..00000000 --- a/openjdk-8-nanoserver/mvn-entrypoint.ps1 +++ /dev/null @@ -1,49 +0,0 @@ - -# Copy files from C:/ProgramData/Maven/Reference into ${MAVEN_CONFIG} -# So the initial ~/.m2 is set with expected content. -# Don't override, as this is just a reference setup - -function Copy-ReferenceFiles() { - $log = "${env:MAVEN_CONFIG}/copy_reference_file.log" - $ref = "C:/ProgramData/Maven/Reference" - - $repo = Join-Path $env:MAVEN_CONFIG 'repository' - - New-Item -Path $repo -ItemType Directory -Force | Out-Null - Write-Output $null > $log - if((Test-Path $repo) -and (Test-Path $log)) { - $count = (Get-ChildItem $repo | Measure-Object).Count - if($count -eq 0) { - # destination is empty... - Add-Content -Path $log -Value "--- Copying all files to ${env:MAVEN_CONFIG} at $(Get-Date)" - Copy-Item -Path "$ref\*" -Destination $env:MAVEN_CONFIG -Force -Recurse | Add-Content -Path $log - } else { - # destination is non-empty, copy file-by-file - Add-Content -Path $log -Value "--- Copying individual files to ${MAVEN_CONFIG} at $(Get-Date)" - Get-ChildItem -Path $ref -File | ForEach-Object { - Push-Location $ref - $rel = Resolve-Path -Path $($_.FullName) -Relative - Pop-Location - if(!(Test-Path (Join-Path $env:MAVEN_CONFIG $rel)) -or (Test-Path $('{0}.override' -f $_.FullName))) { - $dir = Join-Path $env:MAVEN_CONFIG $($rel.DirectoryName) - if(!(Test-Path $dir)) { - New-Item -Path $dir -ItemType Directory | Out-Null - } - Copy-Item -Path $_.FullName -Destination (Join-Path $env:MAVEN_CONFIG $rel) | Add-Content -Path $log - } - } - } - Add-Content -Path $log -Value "" - } else { - Write-Warning "Can not write to ${log}. Wrong volume permissions? Carrying on ..." - } -} - -Push-Location -StackName 'maven-entrypoint' -Copy-ReferenceFiles -Pop-Location -StackName 'maven-entrypoint' - -Remove-Item Env:\MAVEN_CONFIG - -Invoke-Expression "$args" -exit $lastExitCode diff --git a/openjdk-8-nanoserver/settings-docker.xml b/openjdk-8-nanoserver/settings-docker.xml deleted file mode 100644 index 9cd1a5ea..00000000 --- a/openjdk-8-nanoserver/settings-docker.xml +++ /dev/null @@ -1,6 +0,0 @@ - - C:\ProgramData\Maven\Reference\repository - diff --git a/openjdk-8-windowsservercore/Dockerfile b/openjdk-8-windowsservercore/Dockerfile deleted file mode 100644 index a99d6726..00000000 --- a/openjdk-8-windowsservercore/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# escape=` -FROM openjdk:8-jdk-windowsservercore-1809 - -LABEL org.opencontainers.image.title="Apache Maven" -LABEL org.opencontainers.image.source=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.url=https://github.com/carlossg/docker-maven -LABEL org.opencontainers.image.description="Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information." - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG USER_HOME_DIR="C:/Users/ContainerUser" -ARG MAVEN_VERSION=3.9.9 -ARG SHA=8beac8d11ef208f1e2a8df0682b9448a9a363d2ad13ca74af43705549e72e74c9378823bf689287801cbbfc2f6ea9596201d19ccacfdfb682ee8a2ff4c4418ba -ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries - -RUN Invoke-WebRequest -Uri ${env:BASE_URL}/apache-maven-${env:MAVEN_VERSION}-bin.zip -OutFile ${env:TEMP}/apache-maven.zip ; ` - if((Get-FileHash -Algorithm SHA512 -Path ${env:TEMP}/apache-maven.zip).Hash.ToLower() -ne ${env:SHA}) { exit 1 } ; ` - Expand-Archive -Path ${env:TEMP}/apache-maven.zip -Destination C:/ProgramData ; ` - Move-Item C:/ProgramData/apache-maven-${env:MAVEN_VERSION} C:/ProgramData/Maven ; ` - New-Item -ItemType Directory -Path C:/ProgramData/Maven/Reference | Out-Null ; ` - Remove-Item ${env:TEMP}/apache-maven.zip - -ENV MAVEN_HOME=C:/ProgramData/Maven -ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2" - -COPY mvn-entrypoint.ps1 C:/ProgramData/Maven/mvn-entrypoint.ps1 -COPY settings-docker.xml C:/ProgramData/Maven/Reference/settings-docker.xml - -RUN setx /M PATH $('{0};{1}' -f $env:PATH,'C:\ProgramData\Maven\bin') | Out-Null - -USER ContainerUser -ENV JAVA_HOME=${JAVA_HOME} - -ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Maven/mvn-entrypoint.ps1"] -CMD ["mvn"] diff --git a/openjdk-8-windowsservercore/mvn-entrypoint.ps1 b/openjdk-8-windowsservercore/mvn-entrypoint.ps1 deleted file mode 100644 index 13e3319b..00000000 --- a/openjdk-8-windowsservercore/mvn-entrypoint.ps1 +++ /dev/null @@ -1,49 +0,0 @@ - -# Copy files from C:/ProgramData/Maven/Reference into ${MAVEN_CONFIG} -# So the initial ~/.m2 is set with expected content. -# Don't override, as this is just a reference setup - -function Copy-ReferenceFiles() { - $log = "${env:MAVEN_CONFIG}/copy_reference_file.log" - $ref = "C:/ProgramData/Maven/Reference" - - $repo = Join-Path $env:MAVEN_CONFIG 'repository' - - New-Item -Path $repo -ItemType Directory -Force | Out-Null - Write-Output $null > $log - if((Test-Path $repo) -and (Test-Path $log)) { - $count = (Get-ChildItem $repo | Measure-Object).Count - if($count -eq 0) { - # destination is empty... - Add-Content -Path $log -Value "--- Copying all files to ${env:MAVEN_CONFIG} at $(Get-Date)" - Copy-Item -Path "$ref\*" -Destination $env:MAVEN_CONFIG -Force -Recurse | Add-Content -Path $log - } else { - # destination is non-empty, copy file-by-file - Add-Content -Path $log -Value "--- Copying individual files to ${MAVEN_CONFIG} at $(Get-Date)" - Get-ChildItem -Path $ref -File | ForEach-Object { - Push-Location $ref - $rel = Resolve-Path -Path $($_.FullName) -Relative - Pop-Location - if(!(Test-Path (Join-Path $env:MAVEN_CONFIG $rel)) -or (Test-Path $('{0}.override' -f $_.FullName))) { - $dir = Join-Path $env:MAVEN_CONFIG $($rel.DirectoryName) - if(!(Test-Path $dir)) { - New-Item -Path $dir -ItemType Directory | Out-Null - } - Copy-Item -Path $_.FullName -Destination (Join-Path $env:MAVEN_CONFIG $rel) | Add-Content -Path $log - } - } - } - Add-Content -Path $log -Value "" - } else { - Write-Warning "Can not write to ${log}. Wrong volume permissions? Carrying on ..." - } -} - -Push-Location -StackName 'maven-entrypoint' -Copy-ReferenceFiles -Pop-Location -StackName 'maven-entrypoint' - -Remove-Item Env:\MAVEN_CONFIG - -Invoke-Expression "$args" -exit $lastExitCode diff --git a/openjdk-8-windowsservercore/settings-docker.xml b/openjdk-8-windowsservercore/settings-docker.xml deleted file mode 100644 index 9cd1a5ea..00000000 --- a/openjdk-8-windowsservercore/settings-docker.xml +++ /dev/null @@ -1,6 +0,0 @@ - - C:\ProgramData\Maven\Reference\repository - diff --git a/tests/tests.bats b/tests/tests.bats index a13c8267..4a0e7826 100644 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -124,8 +124,7 @@ base_image=eclipse-temurin-17 @test "$SUT_TAG which is installed" { if ! ( - [[ "$SUT_TAG" == openjdk-?? ]] || - [[ "$SUT_TAG" == *"oracle"* ]] || + [[ "$SUT_TAG" == *"oracle"* ]] || [[ "$SUT_TAG" == "amazoncorretto-23" ]] || [[ "$SUT_TAG" == "amazoncorretto-23-al2023" ]] ); then @@ -146,7 +145,6 @@ base_image=eclipse-temurin-17 if ! ( [[ "$SUT_TAG" == "amazoncorretto-"* ]] || [[ "$SUT_TAG" == libericaopenjdk-*-debian ]] || - [[ "$SUT_TAG" == openjdk-?? ]] || [[ "$SUT_TAG" == *"graalvm"* ]] || [[ "$SUT_TAG" == azulzulu-*-debian ]] @@ -164,7 +162,6 @@ base_image=eclipse-temurin-17 [[ "$SUT_TAG" == amazoncorretto-?? ]] || [[ "$SUT_TAG" == amazoncorretto-*-al2023 ]] || [[ "$SUT_TAG" == eclipse-temurin-* ]] || - [[ "$SUT_TAG" == openjdk-?? ]] || [[ "$SUT_TAG" == *"graalvm"* ]] ); then run docker run --rm $SUT_IMAGE:$SUT_TAG gpg --version