harrisbaird / dockerfiles

Various Dockerfiles.
https://hub.docker.com/u/harrisbaird/
9 stars 0 forks source link

PID not found #1

Closed drozzy closed 7 years ago

drozzy commented 7 years ago

Hi, can you help me?

I'm trying to do something similar to what you indicated in your readme. Upload the spiders to the scrapyd server during docker build time.

I'm using the python2.7-onbuild image.

Here is my complete Dockerfile:

FROM python:2.7-onbuild

# Briefly run scrapyd and upload spiders
RUN scrapyd & PID=$! && \
    echo "Waiting for Scrapyd to start" && \
    sleep 2 && \
    sh deploy.sh && \
    kill &PID

CMD ["scrapyd"]

But my build fails:

---> Running in 5aca47c5f793
Waiting for Scrapyd to start
/bin/sh: 1: PID: not found
The command '/bin/sh -c scrapyd & PID=$! &&     echo "Waiting for Scrapyd to start" &&     sleep 2 &&     sh deploy.sh &&     kill &PID' returned a non-zero code: 127

I'm wondering if this is because I'm not using Alpine?

Thank you.

drozzy commented 7 years ago

Nevermind, I was using &PID and not $PID.