linux - How to run docker rmi $(docker images -a -q) in Jenkins as part of ssh script -
i building jenkins jobs build docker container on aws ec2 instance , sample of jenkins script giving errors: #!/bin/bash -e # not giving ip here guess can understand host = ip address of ec2 instance in aws # current project workspace # download source code , create tar , scp in aws ec2 # code copied in aws ec2 instance ... # ssh , run script on aws ec2 instance ssh -o stricthostkeychecking=no -i mysecrets.pem ec2-user@$host \ "tar xvf pc.tar && \ cd my_project_source_code && \ docker stop $(docker ps -a -q) && \ docker rmi $(docker images -a -q) && \ sh -c 'nohup docker-compose kill > /dev/null 2>&1 &' && \ docker-compose build --no-cache && \ sh -c 'nohup docker-compose > /dev/null 2>&1 &' " when build job in jenkins, fails following error on output console : "docker stop" requires @ least 1 argument(s). see 'docker stop --...