I have the following Python code written as part of an AWS Lambda:
import json
import os
def lambda_handler(event, context):
os.system("docker cp panaxeaA1/ panaxea:app/phdcode")
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
Which returns the following error:
16:21:23
START RequestId: 5693fd73-debb-11e8-9a71-ff6726b7be00 Version: $LATEST
16:21:23
sh: docker: command not found
16:21:23
END RequestId: 5693fd73-debb-11e8-9a71-ff6726b7be00
16:21:23
REPORT RequestId: 5693fd73-debb-11e8-9a71-ff6726b7be00 Duration: 16.04 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB
No newer events found at the moment. Retry.
Docker is installed on the instance though... Any advice? I was under the impression I could make cmd calls via python?