brokkar
brokkar

Reputation: 41

docker build: Returned a non-zero code: 5

I wonna run this (https://github.com/thomashossler/synthetic-data-generator#config-file) project and I can't build the docker image. I didn't find this error on stackoverflow so i hope you can help me

/synthetic-data-generator$ docker build . -f Dockerfile 
Sending build context to Docker daemon  3.944MB
Step 1/11 : FROM python:3.6
 ---> 0668df180a32
Step 2/11 : RUN apt-get update &&     apt-get install -y         
bzip2         git         git-core         libfontconfig1         
libgconf-2-4         libglu1         libsm6         libxext6         
libxrender1         vim         wget
 ---> Using cache
 ---> 0c92c577bdf4
Step 3/11 : WORKDIR /root/
 ---> Using cache
 ---> 2221c959662d
Step 4/11 : RUN wget -c --quiet 
download.blender.org/release/Blender2.79/blender-2.79a-linux- 
glibc219-x86_64.tar.bz2 &&     tar -xf blender-2.79a-linux-glibc219- 
x86_64.tar.bz2 &&     rm blender-2.79a-linux-glibc219-x86_64.tar.bz2 
&&     mv blender-2.79a-linux-glibc219-x86_64/ blender/ &&     cp -r 
blender /usr/lib/blender &&     echo "export 
PATH="/usr/lib/blender:$PATH"" >> /root/.bashrc
 ---> Running in 03a48a002fe6
The command '/bin/sh -c wget -c --quiet 
download.blender.org/release/Blender2.79/blender-2.79a-linux- 
glibc219-x86_64.tar.bz2 &&     tar -xf blender-2.79a-linux-glibc219- 
x86_64.tar.bz2 &&     rm blender-2.79a-linux-glibc219-x86_64.tar.bz2 
&&     mv blender-2.79a-linux-glibc219-x86_64/ blender/ &&     cp -r 
blender /usr/lib/blender &&     echo "export 
PATH="/usr/lib/blender:$PATH"" >> /root/.bashrc' returned a non-zero 
code: 5

my Dockerfile

FROM python:3.6

RUN apt-get update && \
    apt-get install -y \
        bzip2 \
        git \
        git-core \
        libfontconfig1 \
        libgconf-2-4 \
        libglu1 \
        libsm6 \
        libxext6 \
        libxrender1 \
        vim \
        wget

WORKDIR /root/
RUN wget -c --quiet 
download.blender.org/release/Blender2.79/blender-2.79a-linux- 
   glibc219-x86_64.tar.bz2 && \
tar -xf blender-2.79a-linux-glibc219-x86_64.tar.bz2 && \
rm blender-2.79a-linux-glibc219-x86_64.tar.bz2 && \
mv blender-2.79a-linux-glibc219-x86_64/ blender/ && \
cp -r blender /usr/lib/blender && \
echo "export PATH="/usr/lib/blender:$PATH"" >> /root/.bashrc


COPY /src/requirements.txt /root
RUN pip3 install -r /root/requirements.txt

RUN pip3 install --user 
git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI

COPY models /root/models/
COPY src /root/
COPY deploy/config.json /root/

CMD ["python3", "dataset_creation.py"]
# ENTRYPOINT ["/root/entrypoint.sh"]
#EXPOSE 8889
#CMD ["jupyter notebook", "--ip=0.0.0.0", "--allow-root", "--port=8889"]

Can anyone have similar experience and give me an solution. Very appreciated!

Upvotes: 4

Views: 10068

Answers (2)

needfulthing
needfulthing

Reputation: 1096

For me using the wget parameter "--no-check-certificate" removed the SSL error. I assume because you do not have a valid certificate store in the build process environment, wget cannot check if the certificate from a https connection is valid.

Upvotes: 2

Nick Rundle
Nick Rundle

Reputation: 629

It is most likely failing on the wget command. That RUN line has 6 separate commands. The other 5 would all likely produce some error message if they failed. The wget has the --quiet flag passed which is suppressing output.

To debug further, try removing the --quiet flag from the wget.

From man wget, EXIT STATUS of 5 = SSL verification error. Perhaps you are behind a corporate proxy and do not have the SSL certs installed in the container that is running the wget.

Upvotes: 9

Related Questions