mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Always use es tarball for creating IronBank docker context (#95958)
This fixes an issue with building iron bank images that are handled differently than other docker images.
This commit is contained in:
parent
a7f2b3deaa
commit
cc2a711b2d
1 changed files with 19 additions and 8 deletions
|
@ -79,6 +79,10 @@ configurations {
|
||||||
attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
|
attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Iron bank images require a tarball
|
||||||
|
aarch64DockerSourceTar
|
||||||
|
dockerSourceTar
|
||||||
|
|
||||||
log4jConfig
|
log4jConfig
|
||||||
tini
|
tini
|
||||||
allPlugins
|
allPlugins
|
||||||
|
@ -92,7 +96,9 @@ String tiniArch = Architecture.current() == Architecture.AARCH64 ? 'arm64' : 'am
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
aarch64DockerSource project(":distribution:archives:linux-aarch64-tar")
|
aarch64DockerSource project(":distribution:archives:linux-aarch64-tar")
|
||||||
|
aarch64DockerSourceTar project(path: ":distribution:archives:linux-aarch64-tar", configuration:"default")
|
||||||
dockerSource project(":distribution:archives:linux-tar")
|
dockerSource project(":distribution:archives:linux-tar")
|
||||||
|
dockerSourceTar project(path: ":distribution:archives:linux-tar", configuration:"default")
|
||||||
log4jConfig project(path: ":distribution", configuration: 'log4jConfig')
|
log4jConfig project(path: ":distribution", configuration: 'log4jConfig')
|
||||||
tini "krallin:tini:0.19.0:${tiniArch}"
|
tini "krallin:tini:0.19.0:${tiniArch}"
|
||||||
allPlugins project(path: ':plugins', configuration: 'allPlugins')
|
allPlugins project(path: ':plugins', configuration: 'allPlugins')
|
||||||
|
@ -310,11 +316,15 @@ void addTransformDockerContextTask(Architecture architecture, DockerBase base) {
|
||||||
String distributionFolderName = "elasticsearch-${VersionProperties.elasticsearch}"
|
String distributionFolderName = "elasticsearch-${VersionProperties.elasticsearch}"
|
||||||
|
|
||||||
from(tarTree("${project.buildDir}/distributions/${archiveName}.tar.gz")) {
|
from(tarTree("${project.buildDir}/distributions/${archiveName}.tar.gz")) {
|
||||||
eachFile { FileCopyDetails details ->
|
|
||||||
if (details.name.equals("Dockerfile")) {
|
if (base != DockerBase.IRON_BANK) {
|
||||||
filter { String contents ->
|
// iron bank always needs a COPY with the tarball file path
|
||||||
return contents.replaceAll('^RUN curl.*artifacts-no-kpi.*$', "COPY $distributionFolderName .")
|
eachFile { FileCopyDetails details ->
|
||||||
.replaceAll('^RUN tar -zxf /tmp/elasticsearch.tar.gz --strip-components=1$', "")
|
if (details.name.equals("Dockerfile")) {
|
||||||
|
filter { String contents ->
|
||||||
|
return contents.replaceAll('^RUN curl.*artifacts-no-kpi.*$', "COPY $distributionFolderName .")
|
||||||
|
.replaceAll('^RUN tar -zxf /tmp/elasticsearch.tar.gz --strip-components=1$', "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -322,12 +332,13 @@ void addTransformDockerContextTask(Architecture architecture, DockerBase base) {
|
||||||
into "${project.buildDir}/docker-context/${archiveName}"
|
into "${project.buildDir}/docker-context/${archiveName}"
|
||||||
|
|
||||||
// Since we replaced the remote URL in the Dockerfile, copy in the required file
|
// Since we replaced the remote URL in the Dockerfile, copy in the required file
|
||||||
from(architecture == Architecture.AARCH64 ? configurations.aarch64DockerSource : configurations.dockerSource)
|
if(base == DockerBase.IRON_BANK) {
|
||||||
|
from(architecture == Architecture.AARCH64 ? configurations.aarch64DockerSourceTar : configurations.dockerSourceTar)
|
||||||
if (base == DockerBase.IRON_BANK) {
|
|
||||||
from (configurations.tini) {
|
from (configurations.tini) {
|
||||||
rename { _ -> 'tini' }
|
rename { _ -> 'tini' }
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
from(architecture == Architecture.AARCH64 ? configurations.aarch64DockerSource : configurations.dockerSource)
|
||||||
}
|
}
|
||||||
|
|
||||||
expansions(architecture, base).findAll { it.key != 'build_date' }.each { k, v ->
|
expansions(architecture, base).findAll { it.key != 'build_date' }.each { k, v ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue