miniconda.sh:无法在 CircleCI 上执行二进制文件

miniconda.sh:无法在 CircleCI 上执行二进制文件

我正在尝试在 CircleCI 上的 Docker 映像中安装 miniconda,在映像中 circleci/python:3.8.1-buster。文件的相关部分config.yml是:

        - run:
            name: Setup Miniconda
            command: |
              cd $HOME
              wget "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh" -O miniconda.sh
              chmod +x ~/miniconda.sh
              lscpu
              source miniconda.sh -b -u

它在最后一步失败了:

/bin/bash: line 8: source: miniconda.sh: cannot execute binary file

Exited with code exit status 126

lscpu为什么会这样?所有答案都指向 32/64 位问题,但机器上的输出显示 64 位处理器:

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       46 bits physical, 48 bits virtual
CPU(s):              36
On-line CPU(s) list: 0-35
Thread(s) per core:  2
Core(s) per socket:  18
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
Stepping:            4
CPU MHz:             3400.068
BogoMIPS:            5999.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            25344K
NUMA node0 CPU(s):   0-35

编辑:输出ðf /home/circleci/anaconda.sh和挂载:

Filesystem     1K-blocks   Used Available Use% Mounted on
overlay        314572800 687992 313884808   1% /
overlay on / type overlay (rw,relatime,lowerdir=/var/lib/docker/231072.231072/overlay2/l/J5IWZGHJNARUQC7X4CTO4BQ5ES:/var/lib/docker/231072.231072/overlay2/l/XD3PZDOGNYU2YYHXGHCLNOUVAC:/var/lib/docker/231072.231072/overlay2/l/CA7AZTLLGSK4OEUHU4BEOEUPIZ:/var/lib/docker/231072.231072/overlay2/l/DYOXGGA7RXPQHYWEG3ZXBAFKEQ:/var/lib/docker/231072.231072/overlay2/l/EYCBKX2PUH43IQJCIH23BDYYQS:/var/lib/docker/231072.231072/overlay2/l/YDXS6RTH4KKHJ4OKCV3SGEQSHF:/var/lib/docker/231072.231072/overlay2/l/XDZBSFNC2FX7SVQREIWX3OGHVV:/var/lib/docker/231072.231072/overlay2/l/FE4RM6NUAZK7BQFAECHFBIMSUG:/var/lib/docker/231072.231072/overlay2/l/7YUOGPPFPIBDQ4M3RBYYYQ4JXV:/var/lib/docker/231072.231072/overlay2/l/6764TLBVJENFCAR3XG5NA2QFLH:/var/lib/docker/231072.231072/overlay2/l/6LISH4KPYTHH4LYFAG52BLTJ44,upperdir=/var/lib/docker/231072.231072/overlay2/21378034c56dca452822d84486f51f01380f9bd9d70a8f383da40faa876bf328/diff,workdir=/var/lib/docker/231072.231072/overlay2/21378034c56dca452822d84486f51f01380f9bd9d70a8f383da40faa876bf328/work)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
...

答案1

从我看过的 Anaconda/Miniconda 文档来看,您需要使用 Bash 来调用脚本,而不仅仅是source它。您仍然可以添加任何您想要的参数来进行静默安装。

来自安装说明

To run the silent installation of Miniconda for macOS or Linux, specify the -b and -p arguments of the bash installer. The following arguments are supported:

    -b—Batch mode with no PATH modifications to ~/.bashrc. Assumes that you agree to the license agreement. Does not edit the .bashrc or .bash_profile files.
    -p—Installation prefix/path.
    -f—Force installation even if prefix -p already exists.

EXAMPLE:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda

相关内容