I tried with #!/usr/bin/bash
and #!/usr/bin/env/sh
and #!/usr/bin/env/ bash
docker run -t -i image-id /bin/sh
is what i use and use ls
and i see that the file is there
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c970708c1a3 bd24c6bef682 "/bin/sh -c 'sh benc…" 7 minutes ago Exited (127) 7 minutes ago amazing_lovelace
I am able to run both these commands individually and they work
echo "Getting the Container Name"
containerName=$(docker ps -l --format '{{.Names}}' 2>&1)
echo "Transfering the text file"
docker cp $containerName:/benchmark.txt /Users/xxxx/Devlocal/xxxxx/tests/logs/benchmark.txt
when put in a shell script and run i get: ERROR
benchmark.sh: line 13: docker: not found
The command '/bin/sh -c sh benchmark.sh' returned a non-zero code: 127
please help dockerfile
FROM gliderlabs/alpine:3.5
MAINTAINER LN
RUN apk add --update alpine-sdk openssl-dev
RUN apk add --no-cache git
RUN git clone https://github.com/giltene/wrk2.git && cd wrk2 && make
ADD ["benchmark.sh", "/benchmark.sh"]
RUN sh benchmark.sh