• DevOps
  • devops 自定义jenkins agent node docker build 异常

chilianyi 基于nodejs 去构建的 需要基于base 么 如果基于base的话那我还可以使用nodejs的功能么

chilianyi 我刚试了一下基于base自定义node18的镜像还是不

[upl-image-preview url=

]

构建镜像脚本:

# docker run -it kubespheredev/builder-base:v3.1.0 envsubst -V
envsubst (GNU gettext-runtime) 0.19.8.1
Copyright (C) 2003-2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Bruno Haible.

我试了下,原生带的。 你用这个 配置,casc 对应 configmap 里找到对应的 image id,进去看下,有 envsubst 这个 命令吗

    qweqe417 我试了下这个 image,是没有装 envsubst

    docker run --network=host -it node:18.13.0 bash
    
    root@node1:/# envsubst
    bash: envsubst: command not found
    root@node1:/# apt-get update
    Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
    Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
    Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
    Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
    Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [228 kB]
    Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]
    Fetched 8634 kB in 10s (833 kB/s)
    Reading package lists... Done
    root@node1:/# apt install gettext-base
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following NEW packages will be installed:
      gettext-base
    0 upgraded, 1 newly installed, 0 to remove and 28 not upgraded.
    Need to get 175 kB of archives.
    After this operation, 675 kB of additional disk space will be used.
    Get:1 http://deb.debian.org/debian bullseye/main amd64 gettext-base amd64 0.21-4 [175 kB]
    Fetched 175 kB in 1s (128 kB/s)
    debconf: delaying package configuration, since apt-utils is not installed
    Selecting previously unselected package gettext-base.
    (Reading database ... 22790 files and directories currently installed.)
    Preparing to unpack .../gettext-base_0.21-4_amd64.deb ...
    Unpacking gettext-base (0.21-4) ...
    Setting up gettext-base (0.21-4) ...
    root@node1:/# env
    env       envsubst
    root@node1:/# envsubst -V
    envsubst (GNU gettext-runtime) 0.21
    Copyright (C) 2003-2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Written by Bruno Haible.

    你可以试试在 Dockerfile 中,装上这个 gettext-base

      chilianyi 谢谢指点 解决了,不过有个建议 如果您是官方人员建议把自定义agent 的那个文档补充完整一些,按照你们现在那个文档来,自定义镜像那块好多不确定的点,我一路踩了好多坑。

        1 年 后

        yongpanyan 是否要基于 base 镜像,可以自己决定;base 镜像安装了一些命令,如果不基于 base 镜像,自己需要的命令需要在自定义的镜像里安装;

        1 个月 后