docker运行的gitlab-runner ci在运行canvas.node时找不到GLIBCXX_3.4.21

发布于 2022-09-12 23:58:39 字数 12576 浏览 26 评论 0

CentOS Linux 7 (Core)

Docker版本: version 1.13.1, build 774336d/1.13.1

gitlab-runner镜像版本: docker.io/gitlab/gitlab-runner:latest

在阿里云服务器centos7的docker中运行的gitlab-runner容器执行ci的时候报错如下:

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /builds/xxx/xxxxxxx/node_modules/canvas/build/Release/canvas.node)

gcc版本如下:

执行

$ strings /usr/lib64/libstdc++.so.6 |grep GLIBC


其中包含了报错中提到的GLIBCXX_3.4.21

下面是gtilab-runner的容器信息

[
    {
        "Id": "a87528e4be2af555f559dfd16f785e06fd3884b0cdf40e45c8c9c8549ac45075",
        "Created": "2021-05-29T03:54:34.756429427Z",
        "Path": "/usr/bin/dumb-init",
        "Args": [
            "/entrypoint",
            "run",
            "--user=gitlab-runner",
            "--working-directory=/home/gitlab-runner"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 7592,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2021-05-29T03:54:35.051862469Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:6965be4d803225f1ec1c292273f8708a40d53affed03d84625b9ca8477c5ce74",
        "ResolvConfPath": "/var/lib/docker/containers/a87528e4be2af555f559dfd16f785e06fd3884b0cdf40e45c8c9c8549ac45075/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/a87528e4be2af555f559dfd16f785e06fd3884b0cdf40e45c8c9c8549ac45075/hostname",
        "HostsPath": "/var/lib/docker/containers/a87528e4be2af555f559dfd16f785e06fd3884b0cdf40e45c8c9c8549ac45075/hosts",
        "LogPath": "/var/lib/docker/containers/a87528e4be2af555f559dfd16f785e06fd3884b0cdf40e45c8c9c8549ac45075/a87528e4be2af555f559dfd16f785e06fd3884b0cdf40e45c8c9c8549ac45075-json.log",
        "Name": "/gitlab-runner",
        "RestartCount": 0,
        "Driver": "overlay2",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/var/run/docker.sock:/var/run/docker.sock",
                "/srv/gitlab-runner/config:/etc/gitlab-runner"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "docker-runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Name": "overlay2",
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/3eed756475917bfc622c39297576a39dce03eec5ad8108500742cf386f3b8ca5-init/diff:/var/lib/docker/overlay2/bb6ca2b2e6ead5a09cdd913acc28a3c614604962ddfe4fa191a9cf795ebc8454/diff:/var/lib/docker/overlay2/715c2b9d5d6af47ff9db11bdf242a03f0fb7c64cfeed697af0da6df112f20757/diff:/var/lib/docker/overlay2/f1f62ea9114de0145a8404d121fb902015394e48d7adc83b81fa2898f3263f38/diff:/var/lib/docker/overlay2/7e425e0c24636582d52d63716443dde3c671e9b4b433765fe755074ab92f8c7d/diff:/var/lib/docker/overlay2/a358629434cf0ee8899edfaefbafc57ba3dbdaca4bfe04e2a197010f66f0bf20/diff:/var/lib/docker/overlay2/47bc5868c24c1fd810f4a381c8978f2008f4be90048546ac62dadbbae954e90c/diff:/var/lib/docker/overlay2/e6e0428fe34b61b79be00aac13b9f3559d6e3729230f52c8f877b4853cb56b2d/diff",
                "MergedDir": "/var/lib/docker/overlay2/3eed756475917bfc622c39297576a39dce03eec5ad8108500742cf386f3b8ca5/merged",
                "UpperDir": "/var/lib/docker/overlay2/3eed756475917bfc622c39297576a39dce03eec5ad8108500742cf386f3b8ca5/diff",
                "WorkDir": "/var/lib/docker/overlay2/3eed756475917bfc622c39297576a39dce03eec5ad8108500742cf386f3b8ca5/work"
            }
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/srv/gitlab-runner/config",
                "Destination": "/etc/gitlab-runner",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "6ad1070a7183e17095bb129a2f2a934ae61b2c01afcb6b7fcb64dab801ba2f4b",
                "Source": "/var/lib/docker/volumes/6ad1070a7183e17095bb129a2f2a934ae61b2c01afcb6b7fcb64dab801ba2f4b/_data",
                "Destination": "/home/gitlab-runner",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "a87528e4be2a",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DEBIAN_FRONTEND=noninteractive"
            ],
            "Cmd": [
                "run",
                "--user=gitlab-runner",
                "--working-directory=/home/gitlab-runner"
            ],
            "ArgsEscaped": true,
            "Image": "gitlab/gitlab-runner:latest",
            "Volumes": {
                "/etc/gitlab-runner": {},
                "/home/gitlab-runner": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/usr/bin/dumb-init",
                "/entrypoint"
            ],
            "OnBuild": null,
            "Labels": {},
            "StopSignal": "SIGQUIT"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "1cf20c5115dd97bf0b89b12011f54300658de9d484068f241ee740f6041e4d36",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/1cf20c5115dd",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "f5e95c6f8df53f3fb28c267dc50a891f763d60ef60cca93b0c06fb95e081ad09",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "4604c4599dce8ee4b6683d1427c326fef4e81b222777ad4c7c2df5c52a530d56",
                    "EndpointID": "f5e95c6f8df53f3fb28c267dc50a891f763d60ef60cca93b0c06fb95e081ad09",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02"
                }
            }
        }
    }
]

5月30日

把gcc 版本已经升级到gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)

并且通过查看报错所在文件的挂载目录,可以找到提示缺少的文件

 strings /var/lib/docker/volumes/runner-85338bd2-project-65-concurrent-0-cache-c33bcaa1fd2c77edfc3893b41966cea8/_data/xxx/xxxxxxx/node_modules/canvas/build/Release/libstdc++.so.6 | grep GLIBCXX_3.4.21

GLIBCXX_3.4.21

运行ci报错依旧存在

请各位大佬指点迷津

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

漫雪独思 2022-09-19 23:58:39

gitlab版本和git runner版本一致吗?是多少?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文