mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[docker] Add ubi9 image (#135868)
* [docker] Add ubi9 image * update artifacts tests * cleanup * fixes * formatting
This commit is contained in:
parent
6c08eacdc0
commit
87ac0fd2fe
7 changed files with 35 additions and 23 deletions
|
@ -51,7 +51,17 @@ steps:
|
|||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: KIBANA_DOCKER_CONTEXT=ubi .buildkite/scripts/steps/artifacts/docker_context.sh
|
||||
- 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
|
|
@ -19,8 +19,10 @@ if [[ "$KIBANA_DOCKER_CONTEXT" == "default" ]]; then
|
|||
DOCKER_CONTEXT_FILE="kibana-$FULL_VERSION-docker-build-context.tar.gz"
|
||||
elif [[ "$KIBANA_DOCKER_CONTEXT" == "cloud" ]]; then
|
||||
DOCKER_CONTEXT_FILE="kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
|
||||
elif [[ "$KIBANA_DOCKER_CONTEXT" == "ubi" ]]; then
|
||||
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"
|
||||
|
|
|
@ -86,7 +86,13 @@ export const CreateDockerUBI: Task = {
|
|||
async run(config, log, build) {
|
||||
await runDockerGenerator(config, log, build, {
|
||||
architecture: 'x64',
|
||||
baseImage: 'ubi',
|
||||
baseImage: 'ubi8',
|
||||
context: false,
|
||||
image: true,
|
||||
});
|
||||
await runDockerGenerator(config, log, build, {
|
||||
architecture: 'x64',
|
||||
baseImage: 'ubi9',
|
||||
context: false,
|
||||
image: true,
|
||||
});
|
||||
|
@ -124,9 +130,13 @@ export const CreateDockerContexts: Task = {
|
|||
image: false,
|
||||
dockerBuildDate,
|
||||
});
|
||||
|
||||
await runDockerGenerator(config, log, build, {
|
||||
baseImage: 'ubi',
|
||||
baseImage: 'ubi8',
|
||||
context: true,
|
||||
image: false,
|
||||
});
|
||||
await runDockerGenerator(config, log, build, {
|
||||
baseImage: 'ubi9',
|
||||
context: true,
|
||||
image: false,
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ export async function runDockerGenerator(
|
|||
build: Build,
|
||||
flags: {
|
||||
architecture?: string;
|
||||
baseImage: 'none' | 'ubi' | 'ubuntu';
|
||||
baseImage: 'none' | 'ubi9' | 'ubi8' | 'ubuntu';
|
||||
context: boolean;
|
||||
image: boolean;
|
||||
ironbank?: boolean;
|
||||
|
@ -39,11 +39,12 @@ export async function runDockerGenerator(
|
|||
) {
|
||||
let baseImageName = '';
|
||||
if (flags.baseImage === 'ubuntu') baseImageName = 'ubuntu:20.04';
|
||||
if (flags.baseImage === 'ubi') baseImageName = 'docker.elastic.co/ubi8/ubi-minimal:latest';
|
||||
const ubiVersionTag = 'ubi8';
|
||||
if (flags.baseImage === 'ubi8') baseImageName = 'docker.elastic.co/ubi8/ubi-minimal:latest';
|
||||
if (flags.baseImage === 'ubi9') baseImageName = 'docker.elastic.co/ubi9/ubi-minimal:latest';
|
||||
|
||||
let imageFlavor = '';
|
||||
if (flags.baseImage === 'ubi') imageFlavor += `-${ubiVersionTag}`;
|
||||
if (flags.baseImage === 'ubi8') imageFlavor += `-ubi8`;
|
||||
if (flags.baseImage === 'ubi9') imageFlavor += `-ubi9`;
|
||||
if (flags.ironbank) imageFlavor += '-ironbank';
|
||||
if (flags.cloud) imageFlavor += '-cloud';
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ export interface TemplateContext {
|
|||
dockerBuildDate: string;
|
||||
usePublicArtifact?: boolean;
|
||||
publicArtifactSubdomain: string;
|
||||
baseImage: 'none' | 'ubi' | 'ubuntu';
|
||||
baseImage: 'none' | 'ubi8' | 'ubi9' | 'ubuntu';
|
||||
baseImageName: string;
|
||||
cloud?: boolean;
|
||||
metricbeatTarball?: string;
|
||||
|
|
|
@ -16,8 +16,8 @@ function generator(options: TemplateContext) {
|
|||
const dir = options.ironbank ? 'ironbank' : 'base';
|
||||
const template = readFileSync(resolve(__dirname, dir, './Dockerfile'));
|
||||
return Mustache.render(template.toString(), {
|
||||
packageManager: options.baseImage === 'ubi' ? 'microdnf' : 'apt-get',
|
||||
ubi: options.baseImage === 'ubi',
|
||||
packageManager: options.baseImage.includes('ubi') ? 'microdnf' : 'apt-get',
|
||||
ubi: options.baseImage.includes('ubi'),
|
||||
ubuntu: options.baseImage === 'ubuntu',
|
||||
...options,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue