jenkinsci / docker-agent

Jenkins agent (base image) and inbound agent Docker images
https://hub.docker.com/r/jenkins/inbound-agent/
MIT License
286 stars 230 forks source link

glibc版本太低,存在兼容性问题 #588

Closed chengxiaogong closed 1 year ago

chengxiaogong commented 1 year ago

Jenkins and plugins versions report

Jenkins: 2.401.1 OS: Linux - 3.10.0-1127.el7.x86_64 Java: 11.0.16.1 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

ace-editor:1.1 allure-jenkins-plugin:2.30.3 ansible:240.vc26740a_625c0 ansible-tower:0.16.0 ansicolor:1.0.2 ant:497.v94e7d9fffa_b_9 antisamy-markup-formatter:159.v25bc67cd35fb apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5 apache-httpcomponents-client-5-api:5.2.1-1.0 authentication-tokens:1.53.v1c90fd9191ab authorize-project:1.7.0 aws-credentials:191.vcb_f183ce58b_9 aws-global-configuration:108.v47b_fd43dfec6 aws-java-sdk:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-cloudformation:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-codebuild:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-ec2:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-ecr:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-ecs:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-efs:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-elasticbeanstalk:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-iam:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-kinesis:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-logs:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-minimal:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-sns:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-sqs:1.12.481-392.v8b_291cfcda_09 aws-java-sdk-ssm:1.12.481-392.v8b_291cfcda_09 azure-commons:1.1.3 blueocean:1.27.4 blueocean-autofavorite:1.2.5 blueocean-bitbucket-pipeline:1.27.4 blueocean-commons:1.27.4 blueocean-config:1.27.4 blueocean-core-js:1.27.4 blueocean-dashboard:1.27.4 blueocean-display-url:2.4.2 blueocean-events:1.27.4 blueocean-git-pipeline:1.27.4 blueocean-github-pipeline:1.27.4 blueocean-i18n:1.27.4 blueocean-jira:1.27.4 blueocean-jwt:1.27.4 blueocean-personalization:1.27.4 blueocean-pipeline-api-impl:1.27.4 blueocean-pipeline-editor:1.27.4 blueocean-pipeline-scm-api:1.27.4 blueocean-rest:1.27.4 blueocean-rest-impl:1.27.4 blueocean-web:1.27.4 bootstrap4-api:4.6.0-6 bootstrap5-api:5.3.0-1 bouncycastle-api:2.28 branch-api:2.1122.v09cb_8ea_8a_724 build-monitor-plugin:1.14-717.v3efcdffe8d58 build-user-vars-plugin:1.9 caffeine-api:3.1.6-115.vb_8b_b_328e59d8 checks-api:2.0.0 cloud-stats:267.v577e3742c282 cloudbees-bitbucket-branch-source:809.vc1d904b_30426 cloudbees-folder:6.815.v0dd5a_cb40e0e command-launcher:100.v2f6722292ee8 commons-lang3-api:3.12.0-36.vd97de6465d5b commons-text-api:1.10.0-36.vc008c8fcda7b copyartifact:705.v5295cffec284 cors-filter:1.1 credentials:1254.vb_96f366e7b_a_d credentials-binding:604.vb_64480bc56ca data-tables-api:1.13.4-3 display-url-api:2.3.7 docker-commons:422.v9d1a_89cede51 docker-java-api:3.3.1-79.v20b_53427e041 docker-plugin:1.4 docker-workflow:563.vd5d2e5c4007f durable-task:507.v050055d0cb_dd echarts-api:5.4.0-5 external-monitor-job:206.v9a_94ff0b_4a_10 external-workspace-manager:1.3.1 favorite:2.4.2 font-awesome-api:6.4.0-1 generic-webhook-trigger:1.86.3 git:5.1.0 git-client:4.4.0 git-parameter:0.9.18 git-server:99.va_0826a_b_cdfa_d gitea:1.4.5 github:1.37.1 github-api:1.314-431.v78d72a_3fe4c3 github-branch-source:1728.v859147241f49 gitlab-plugin:1.7.14 gogs-webhook:1.0.15 google-metadata-plugin:0.4 google-oauth-plugin:1.0.9 google-storage-plugin:1.330.v4ef5d39ee2e2 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953 htmlpublisher:1.31 http_request:1.17 image-tag-parameter:2.0 instance-identity:173.va_37c494ec4e5 ionicons-api:56.v1b_1c8c49374e jackson2-api:2.15.2-350.v0c2f3f8fc595 jakarta-activation-api:2.0.1-3 jakarta-mail-api:2.0.1-3 javadoc:233.vdc1a_ec702cff javax-activation-api:1.2.0-6 javax-mail-api:1.6.2-9 jaxb:2.3.8-1 jdk-tool:66.vd8fa_64ee91b_d jenkins-design-language:1.27.4 jersey2-api:2.40-1 jira:3.10 jjwt-api:0.11.5-77.v646c772fddb_0 job-dsl:1.84 job-restrictions:0.8 jquery:1.12.4-1 jquery-detached:1.2.1 jquery3-api:3.7.0-1 jsch:0.2.8-65.v052c39de79b_2 junit:1214.va_2f9db_3e6de0 kubernetes:3952.v88e3b0cf300b kubernetes-cd:2.3.1 kubernetes-client-api:6.4.1-215.v2ed17097a_8e9 kubernetes-credentials:0.10.0 ldap:682.v7b_544c9d1512 localization-support:1.2 localization-zh-cn:1.0.24 lockable-resources:1172.v4b_8fc8eed570 mailer:457.v3f72cb_e015e5 mapdb-api:1.0.9-28.vf251ce40855d matrix-auth:3.1.8 matrix-project:789.v57a_725b_63c79 maven-plugin:3.22 mercurial:1260.vdfb_723cdcc81 metrics:4.2.18-439.v86a_20b_a8318b mina-sshd-api-common:2.10.0-69.v28e3e36d18eb mina-sshd-api-core:2.10.0-69.v28e3e36d18eb momentjs:1.1.1 monitoring:1.94.1 multibranch-scan-webhook-trigger:1.0.9 multiple-scms:0.8 oauth-credentials:0.645.ve666a_c332668 okhttp-api:4.11.0-145.vcb_8de402ef81 pam-auth:1.10 persistent-parameter:1.3 pipeline-aws:1.43 pipeline-build-step:496.v2449a_9a_221f2 pipeline-graph-analysis:202.va_d268e64deb_3 pipeline-groovy-lib:656.va_a_ceeb_6ffb_f7 pipeline-input-step:468.va_5db_051498a_4 pipeline-milestone-step:111.v449306f708b_7 pipeline-model-api:2.2141.v5402e818a_779 pipeline-model-definition:2.2141.v5402e818a_779 pipeline-model-extensions:2.2141.v5402e818a_779 pipeline-rest-api:2.33 pipeline-stage-step:305.ve96d0205c1c6 pipeline-stage-tags-metadata:2.2141.v5402e818a_779 pipeline-stage-view:2.33 pipeline-utility-steps:2.15.4 plain-credentials:143.v1b_df8b_d3b_e48 plugin-util-api:3.3.0 popper-api:1.16.1-3 popper2-api:2.11.6-2 publish-over:0.22 publish-over-ssh:1.24 pubsub-light:1.17 qy-wechat-notification:1.1.3 role-strategy:633.v836e5b_3e80a_5 s3:0.12.3445.vda_704535b_5a_d scm-api:676.v886669a_199aa script-security:1251.vfe552ed55f8d simple-build-for-pipeline:0.2 snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4 sonar:2.15 sonar-quality-gates:1.3.1 sse-gateway:1.26 ssh-credentials:305.v8f4381501156 ssh-slaves:2.877.v365f5eb_a_b_eec ssh-steps:2.0.65.vd26b_5b_9b_de4d sshd:3.303.vefc7119b_ec23 structs:324.va_f5d6774f3a_d subversion:2.17.2 svncompat14:1.1 token-macro:359.vb_cde11682e0c trilead-api:2.84.v72119de229b_7 uno-choice:2.6.5 variant:59.vf075fe829ccb windows-slaves:1.8.1 workflow-aggregator:596.v8c21c963d92d workflow-api:1219.v05cd837ea_249 workflow-basic-steps:1017.vb_45b302f0cea workflow-cps:3697.vb_470e454c232 workflow-cps-global-lib:609.vd95673f149b_b workflow-durable-task-step:1247.v7f9dfea_b_4fd0 workflow-job:1316.vd2290d3341a_f workflow-multibranch:756.v891d88f2cd46 workflow-scm-step:415.v434365564324 workflow-step-api:639.v6eca_cd8c04aa workflow-support:839.v35e2736cfd5c zentimestamp:4.2

What Operating System are you using (both controller, and any agents involved in the problem)?

宿主机操作系统信息详情 NAME="Rocky Linux" VERSION="9.2 (Blue Onyx)" ID="rocky" ID_LIKE="rhel centos fedora" VERSION_ID="9.2" PLATFORM_ID="platform:el9" PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)" ANSI_COLOR="0;32" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:rocky:rocky:9::baseos" HOME_URL="https://rockylinux.org/" BUG_REPORT_URL="https://bugs.rockylinux.org/" SUPPORT_END="2032-05-31" ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9" ROCKY_SUPPORT_PRODUCT_VERSION="9.2" REDHAT_SUPPORT_PRODUCT="Rocky Linux" REDHAT_SUPPORT_PRODUCT_VERSION="9.2"

Reproduction steps

启动命令 docker run --init -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker jenkins/inbound-agent:latest-jdk11 -url http://jenkins_url -workDir=/home/jenkins/agent agent_secret agent_name 报错信息 docker exec -it laughing_liskov sh $ ldd --version ldd (Debian GLIBC 2.31-13+deb11u2) 2.31 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. $ docker ps -a docker: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by docker) docker: /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.34' not found (required by docker)

Expected Results

能够在这个 agent容器中执行docker 进行构建,因为我使用的docker in docker模式进行代码构建

Actual Results

docker exec -it laughing_liskov sh $ ldd --version ldd (Debian GLIBC 2.31-13+deb11u2) 2.31 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. $ docker ps -a docker: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by docker) docker: /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.34' not found (required by docker)

Anything else?

No response

MarkEWaite commented 1 year ago

@chengxiaogong Docker does not support container installations on Red Hat Enterprise Linux 9 or its derivatives as far as I understand their documentation. They offer unsupported ways that might work, but do not support RHEL versions.

You might consider using an operating system that Docker supports, like Debian or Ubuntu.

Running "docker in docker" is an advanced topic with many security risks and operational challenges. Running on an operating system that is not supported by the docker project is is more difficuly.

chengxiaogong commented 1 year ago

@chengxiaogong据我了解,Docker 不支持在 Red Hat Enterprise Linux 9 或其衍生版本上安装容器。它们提供了不受支持的可能可行的方法,但不支持 RHEL 版本。

您可以考虑使用 Docker 支持的操作系统,例如 Debian 或 Ubuntu。

运行“docker in docker”是一个高级主题,存在许多安全风险和操作挑战。在 docker 项目不支持的操作系统上运行会更加困难。 I am running normally on Ubuntu 18.04 operating system, but switching to Rocky Linux 9.2 (Blue Onyx) operating system will cause the above issue

MarkEWaite commented 1 year ago

I am running normally on Ubuntu 18.04 operating system, but switching to Rocky Linux 9.2 (Blue Onyx) operating system will cause the above issue

Ubuntu 18.04 is no longer supported. Use Ubuntu 22.04.