AWS EC2 / usr / bin / docker-compose:无法执行二进制文件

时间:2019-09-27 15:36:15

标签: docker amazon-ec2 docker-compose aws-ssm

我创建了一个EC2实例并在其上安装了docker,现在我需要使用SSM docker-compose安装send-command并执行以下命令:

aws ssm send-command --instance-ids "${INSTACES_ID}" \
    --document-name "AWS-RunShellScript" \
    --parameters "commands=[
            sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)"  -o /usr/local/bin/docker-compose,
            sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose,
            sudo chmod +x /usr/bin/docker-compose,
            docker-compose --version
        ]"

命令正确执行,但命令docker-compose --version引发以下异常

"StandardErrorContent": "... /usr/bin/docker-compose: cannot execute binary file\nfailed to run commands: exit status 126" 

我通过ssh进入EC2,问题是一样的,我也试图赋予bin文件所有权限

$ ls -la /usr/bin | grep docker-compose
-rwxrwxrwx  1 ec2-user ec2-user  6204149 27 set 15.10 docker-compose
$ docker-compose --version
-bash: /usr/bin/docker-compose: cannot execute binary file

0 个答案:

没有答案