From 2853d5965dcef7c3ed5e52a4caf3c851088a2080 Mon Sep 17 00:00:00 2001 From: Davi Mello Date: Thu, 9 Dec 2021 20:29:26 +0000 Subject: [PATCH] EDIT: Change Docker image from CentOS to Ubuntu Changes Notes: To migratre from CentOS to Ubuntu, the following changes are needed: - atk -> libatk1.0-0 - gtk -> GTK3 is installed by default REMOVED - gdk -> libgdk-pixbuf2.0-dev - xrandr -> x11-xserver-utils - pango -> libpango-1.0-0 - libXcomposite -> libxcomposite-dev - libXcursor -> libxcursor-dev - libXdamage -> libxdamage-dev - libXext -> libxext-dev - libXi -> libxi-dev - libXtst -> libxtst-dev - libXScrnSaver -> libxss-dev - libXrandr -> libxrandr-dev - GConf2 -> libgconf2-4 - alsa-lib -> libasound2 - gtk3 -> GTK3 is installed by default REMOVED - ipa-gothic-fonts -> fonts-ipafont-gothic - xorg-x11-fonts-100dpi -> xfonts-100dpi - xorg-x11-fonts-75dpi -> xfonts-75dpi - xorg-x11-utils -> x11-utils - xorg-x11-fonts-cyrillic -> xfonts-cyrillic - xorg-x11-fonts-Type1 -> GET at xfonts-base - xorg-x11-fonts-misc -> xfonts-base --- dev-tools/packaging/packages.yml | 16 +++--- .../docker/Dockerfile.elastic-agent.tmpl | 51 +++++++++++++------ 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/dev-tools/packaging/packages.yml b/dev-tools/packaging/packages.yml index 09efabf28260..690015e98fdf 100644 --- a/dev-tools/packaging/packages.yml +++ b/dev-tools/packaging/packages.yml @@ -475,8 +475,8 @@ shared: - &agent_docker_spec <<: *agent_binary_spec extra_vars: - from: 'centos:7' - buildFrom: 'centos:7' + from: 'ubuntu:20.04' + buildFrom: 'ubuntu:20.04' dockerfile: 'Dockerfile.elastic-agent.tmpl' docker_entrypoint: 'docker-entrypoint.elastic-agent.tmpl' user: '{{ .BeatName }}' @@ -495,8 +495,8 @@ shared: - &agent_docker_arm_spec <<: *agent_docker_spec extra_vars: - from: 'arm64v8/centos:7' - buildFrom: 'arm64v8/centos:7' + from: 'arm64v8/ubuntu:20.04' + buildFrom: 'arm64v8/ubuntu:20.04' - &agent_docker_cloud_spec <<: *agent_docker_spec @@ -653,8 +653,8 @@ shared: - &docker_spec <<: *binary_spec extra_vars: - from: 'centos:7' - buildFrom: 'centos:7' + from: 'ubuntu:20.04' + buildFrom: 'ubuntu:20.04' user: '{{ .BeatName }}' linux_capabilities: '' files: @@ -666,8 +666,8 @@ shared: - &docker_arm_spec <<: *docker_spec extra_vars: - from: 'arm64v8/centos:7' - buildFrom: 'arm64v8/centos:7' + from: 'arm64v8/ubuntu:20.04' + buildFrom: 'arm64v8/ubuntu:20.04' - &docker_ubi_spec extra_vars: diff --git a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl index 38f7934a9d7d..06f15f3fbc99 100644 --- a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl +++ b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl @@ -43,26 +43,47 @@ ENV BEAT_SETUID_AS={{ .user }} RUN for iter in {1..10}; do microdnf update -y && microdnf install -y shadow-utils jq && microdnf clean all && exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && sleep 10; done; (exit $exit_code) {{- else }} # Installing jq needs to be installed after epel-release and cannot be in the same yum install command. -RUN case $(arch) in aarch64) YUM_FLAGS="-x bind-license";; esac; \ - for iter in {1..10}; do \ - yum update -y $YUM_FLAGS && \ - yum install -y epel-release && \ - yum update -y $YUM_FLAGS && \ - yum install -y jq && \ - yum clean all && \ - exit_code=0 && break || exit_code=$? && echo "yum error: retry $iter in 10s" && sleep 10; \ +RUN for iter in {1..10}; do \ + apt update -y && \ + apt install --no-install-recommends --yes jq && \ + apt clean all && \ + exit_code=0 && break || exit_code=$? && echo "apt error: retry $iter in 10s" && sleep 10; \ done; \ (exit $exit_code) {{- end }} +## Changes Notes: To migratre from CentOS to Ubuntu, the following changes are needed: +# atk -> libatk1.0-0 +# gtk -> GTK3 is installed by default REMOVED +# gdk -> libgdk-pixbuf2.0-dev +# xrandr -> x11-xserver-utils +# pango -> libpango-1.0-0 +# libXcomposite -> libxcomposite-dev +# libXcursor -> libxcursor-dev +# libXdamage -> libxdamage-dev +# libXext -> libxext-dev +# libXi -> libxi-dev +# libXtst -> libxtst-dev +# libXScrnSaver -> libxss-dev +# libXrandr -> libxrandr-dev +# GConf2 -> libgconf2-4 +# alsa-lib -> libasound2 +# gtk3 -> GTK3 is installed by default REMOVED +# ipa-gothic-fonts -> fonts-ipafont-gothic +# xorg-x11-fonts-100dpi -> xfonts-100dpi +# xorg-x11-fonts-75dpi -> xfonts-75dpi +# xorg-x11-utils -> x11-utils +# xorg-x11-fonts-cyrillic -> xfonts-cyrillic +# xorg-x11-fonts-Type1 -> GET at xfonts-base +# xorg-x11-fonts-misc -> xfonts-base {{- if (and (contains .image_name "-complete") (not (contains .from "ubi-minimal"))) }} -RUN for iter in {1..10}; do \ - yum -y install atk gtk gdk xrandr pango libXcomposite libXcursor libXdamage \ - libXext libXi libXtst libXScrnSaver libXrandr GConf2 \ - alsa-lib atk gtk3 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils \ - xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc \ - yum clean all && \ - exit_code=0 && break || exit_code=$? && echo "yum error: retry $iter in 10s" && sleep 10; \ +RUN apt update -y && \ + for iter in {1..10}; do \ + apt install --no-install-recommends --yes libatk1.0-0 libgdk-pixbuf2.0-dev x11-xserver-utils libpango-1.0-0 libxcomposite-dev libxcursor-dev libxdamage-dev \ + libxext-dev libxi-dev libxtst-dev libxss-dev libxrandr-dev gconf2 \ + libasound2 fonts-ipafont-gothic xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable xfonts-base x11-utils &&\ + apt clean all && \ + exit_code=0 && break || exit_code=$? && echo "apt error: retry $iter in 10s" && sleep 10; \ done; \ (exit $exit_code) ENV NODE_PATH={{ $beatHome }}/.node