mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[7.17] [docker] Add ubi9 image (#170260)
Backports #135868 Builds available at https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/3392
This commit is contained in:
parent
84071f1f07
commit
a3a94fe4a8
7 changed files with 56 additions and 23 deletions
|
@ -41,7 +41,27 @@ steps:
|
|||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: .buildkite/scripts/steps/artifacts/docker_context.sh
|
||||
- command: KIBANA_DOCKER_CONTEXT=default .buildkite/scripts/steps/artifacts/docker_context.sh
|
||||
label: 'Docker Context Verification'
|
||||
agents:
|
||||
queue: n2-2
|
||||
timeout_in_minutes: 30
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: KIBANA_DOCKER_CONTEXT=ubi8 .buildkite/scripts/steps/artifacts/docker_context.sh
|
||||
label: 'Docker Context Verification'
|
||||
agents:
|
||||
queue: n2-2
|
||||
timeout_in_minutes: 30
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: KIBANA_DOCKER_CONTEXT=ubi9 .buildkite/scripts/steps/artifacts/docker_context.sh
|
||||
label: 'Docker Context Verification'
|
||||
agents:
|
||||
queue: n2-2
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
steps:
|
||||
- command: .buildkite/scripts/steps/docker_context/build.sh
|
||||
label: 'Docker Build Context'
|
||||
agents:
|
||||
queue: n2-4
|
||||
timeout_in_minutes: 30
|
||||
key: build-docker-context
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '*'
|
||||
limit: 1
|
10
.buildkite/scripts/steps/artifacts/docker_context.sh
Normal file → Executable file
10
.buildkite/scripts/steps/artifacts/docker_context.sh
Normal file → Executable file
|
@ -13,7 +13,15 @@ node scripts/build --skip-initialize --skip-generic-folders --skip-platform-fold
|
|||
echo "--- Setup default context"
|
||||
DOCKER_BUILD_FOLDER=$(mktemp -d)
|
||||
|
||||
tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER"
|
||||
if [[ "$KIBANA_DOCKER_CONTEXT" == "default" ]]; then
|
||||
DOCKER_CONTEXT_FILE="kibana-$FULL_VERSION-docker-build-context.tar.gz"
|
||||
elif [[ "$KIBANA_DOCKER_CONTEXT" == "ubi8" ]]; then
|
||||
DOCKER_CONTEXT_FILE="kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz"
|
||||
elif [[ "$KIBANA_DOCKER_CONTEXT" == "ubi9" ]]; then
|
||||
DOCKER_CONTEXT_FILE="kibana-ubi9-$FULL_VERSION-docker-build-context.tar.gz"
|
||||
fi
|
||||
|
||||
tar -xf "target/$DOCKER_CONTEXT_FILE" -C "$DOCKER_BUILD_FOLDER"
|
||||
cd $DOCKER_BUILD_FOLDER
|
||||
|
||||
buildkite-agent artifact download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
|
||||
|
|
|
@ -78,7 +78,13 @@ export const CreateDockerUBI: Task = {
|
|||
await runDockerGenerator(config, log, build, {
|
||||
architecture: 'x64',
|
||||
context: false,
|
||||
ubi: true,
|
||||
ubi8: true,
|
||||
image: true,
|
||||
});
|
||||
await runDockerGenerator(config, log, build, {
|
||||
architecture: 'x64',
|
||||
context: false,
|
||||
ubi9: true,
|
||||
image: true,
|
||||
});
|
||||
},
|
||||
|
@ -115,9 +121,13 @@ export const CreateDockerContexts: Task = {
|
|||
image: false,
|
||||
dockerBuildDate,
|
||||
});
|
||||
|
||||
await runDockerGenerator(config, log, build, {
|
||||
ubi: true,
|
||||
ubi8: true,
|
||||
context: true,
|
||||
image: false,
|
||||
});
|
||||
await runDockerGenerator(config, log, build, {
|
||||
ubi9: true,
|
||||
context: true,
|
||||
image: false,
|
||||
});
|
||||
|
|
|
@ -30,7 +30,8 @@ export async function runDockerGenerator(
|
|||
architecture?: string;
|
||||
context: boolean;
|
||||
image: boolean;
|
||||
ubi?: boolean;
|
||||
ubi8?: boolean;
|
||||
ubi9?: boolean;
|
||||
ubuntu?: boolean;
|
||||
ironbank?: boolean;
|
||||
cloud?: boolean;
|
||||
|
@ -39,11 +40,12 @@ export async function runDockerGenerator(
|
|||
) {
|
||||
let baseOSImage = '';
|
||||
if (flags.ubuntu) baseOSImage = 'ubuntu:22.04';
|
||||
if (flags.ubi) baseOSImage = 'docker.elastic.co/ubi8/ubi-minimal:latest';
|
||||
const ubiVersionTag = 'ubi8';
|
||||
if (flags.ubi8) baseOSImage = 'docker.elastic.co/ubi8/ubi-minimal:latest';
|
||||
if (flags.ubi9) baseOSImage = 'docker.elastic.co/ubi9/ubi-minimal:latest';
|
||||
|
||||
let imageFlavor = '';
|
||||
if (flags.ubi) imageFlavor += `-${ubiVersionTag}`;
|
||||
if (flags.ubi8) imageFlavor += '-ubi8';
|
||||
if (flags.ubi9) imageFlavor += '-ubi9';
|
||||
if (flags.ironbank) imageFlavor += '-ironbank';
|
||||
if (flags.cloud) imageFlavor += '-cloud';
|
||||
|
||||
|
@ -89,7 +91,8 @@ export async function runDockerGenerator(
|
|||
dockerCrossCompile,
|
||||
baseOSImage,
|
||||
dockerBuildDate,
|
||||
ubi: flags.ubi,
|
||||
ubi8: flags.ubi8,
|
||||
ubi9: flags.ubi9,
|
||||
ubuntu: flags.ubuntu,
|
||||
cloud: flags.cloud,
|
||||
metricbeatTarball,
|
||||
|
|
|
@ -22,7 +22,8 @@ export interface TemplateContext {
|
|||
dockerBuildDate: string;
|
||||
usePublicArtifact?: boolean;
|
||||
publicArtifactSubdomain: string;
|
||||
ubi?: boolean;
|
||||
ubi8?: boolean;
|
||||
ubi9?: boolean;
|
||||
ubuntu?: boolean;
|
||||
cloud?: boolean;
|
||||
metricbeatTarball?: string;
|
||||
|
|
|
@ -15,9 +15,11 @@ import { TemplateContext } from '../template_context';
|
|||
function generator(options: TemplateContext) {
|
||||
const dir = options.ironbank ? 'ironbank' : 'base';
|
||||
const template = readFileSync(resolve(__dirname, dir, './Dockerfile'));
|
||||
const ubi = Boolean(options.ubi8 || options.ubi9);
|
||||
return Mustache.render(template.toString(), {
|
||||
packageManager: options.ubi ? 'microdnf' : 'apt-get',
|
||||
packageManager: ubi ? 'microdnf' : 'apt-get',
|
||||
opensslLegacyProvider: !options.cloud,
|
||||
ubi,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue