AWX docker 镜像构建 NPM 错误

问题描述

我一直在尝试构建 AWX docker 镜像,而不是使用托管在 docker hub 上的镜像,因为我们需要为镜像添加一些额外的工具以及根据内部策略所需的其他更改。

即使我离开 use_container_for_build=true 使用中间容器构建 AWX 映像,我还是遇到了以下错误。我们在我正在构建/运行构建 AWX 映像的 Ansible 任务的服务器上安装了 NPM、NodeJ 和其他依赖项。

使用具有最新版本的 AWX 16.0.0 和对清单文件的最小更改,以使用 Kubernetes 上下文和 docker 注册表部分将构建的图像推送到内部私有注册表。

感谢任何线索或解决方法,因为我花了数小时尝试不同的选项,但到目前为止都没有奏效。

TASK [image_build : Build AWX distribution using container] *******************************************************************
task path: /AWXSB/AnsibleAWX/awx/installer/roles/image_build/tasks/main.yml:65
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: myadmin
<localhost> EXEC /bin/sh -c 'echo ~myadmin && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/myadmin/.ansible/tmp `"&& mkdir "` echo /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835 `" && echo ansible-tmp-1609796097.03-19495-93975508577835="` echo /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/docker/docker_container.py
<localhost> PUT /home/myadmin/.ansible/tmp/ansible-local-18837byydxr/tmpFA92wC TO /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/ /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: Failed! => {
    "changed": false,"invocation": {
        "module_args": {
            "api_version": "auto","auto_remove": false,"blkio_weight": null,"ca_cert": null,"cap_drop": null,"capabilities": null,"cleanup": false,"client_cert": null,"client_key": null,"command": null,"comparisons": null,"cpu_period": null,"cpu_quota": null,"cpu_shares": null,"cpuset_cpus": null,"cpuset_mems": null,"debug": false,"detach": false,"device_read_bps": null,"device_read_iops": null,"device_write_bps": null,"device_write_iops": null,"devices": null,"dns_opts": null,"dns_search_domains": null,"dns_servers": null,"docker_host": "unix://var/run/docker.sock","domainname": null,"entrypoint": null,"env": {
                "http_proxy": "","https_proxy": "","no_proxy": ""
            },"env_file": null,"etc_hosts": null,"exposed_ports": null,"force_kill": false,"groups": null,"healthcheck": null,"hostname": null,"ignore_image": false,"image": "awx_sdist_builder:16.0.0","init": false,"interactive": false,"ipc_mode": null,"keep_volumes": true,"kernel_memory": null,"kill_signal": null,"labels": null,"links": null,"log_driver": null,"log_options": null,"mac_address": null,"memory": "0","memory_reservation": null,"memory_swap": null,"memory_swappiness": null,"mounts": null,"name": "awx_sdist_builder","network_mode": null,"networks": null,"networks_cli_compatible": null,"oom_killer": null,"oom_score_adj": null,"output_logs": false,"paused": false,"pid_mode": null,"pids_limit": null,"privileged": false,"published_ports": null,"pull": false,"purge_networks": false,"read_only": false,"recreate": false,"restart": false,"restart_policy": null,"restart_retries": null,"runtime": null,"security_opts": null,"shm_size": null,"ssl_version": null,"state": "started","stop_signal": null,"stop_timeout": null,"sysctls": null,"timeout": 60,"tls": false,"tls_hostname": "localhost","tmpfs": null,"trust_image_content": false,"tty": false,"ulimits": null,"user": "446","userns_mode": null,"uts": null,"validate_certs": false,"volume_driver": null,"volumes": [
                "../:/awx:Z"
            ],"volumes_from": null,"working_dir": null
        }
    },"msg": "npm --prefix awx/ui_next --loglevel warn --ignore-scripts install\nnpm WARN tar EACCES: permission denied,fchown
npm WARN tar EACCES: permission denied,lchown '/awx/awx/ui_next/node_modules/.staging/semver-96a41615/bin'
npm WARN tar EACCES: permission denied,lchown '/awx/awx/ui_next/node_modules/.staging/debug-aeec2e21/src'
npm WARN tar EACCES: permission denied,lchown '/awx/awx/ui_next/node_modules/.staging/@babel/plugin-Syntax-async-generators-9ca6456e/lib'
npm WARN tar EACCES: permission denied,lchown '/awx/awx/ui_next/node_modules/.staging/@babel/helper-validator-option-02f16958/lib'
npm WARN tar EACCES: permission denied,fchown

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)