Debug buildout with docker - docker

I'm trying to fix my buildout. It seems there is a problem with a version of a package we use.
In my Dockerfile I put
COPY buildout.cfg /plone/instance/
RUN buildout -vvv -D
in order to find more about the error I receive.
Then on docker-compose build the debugger starts
> /usr/local/lib/python2.7/site-packages/zc/buildout/easy_install.py(166)call_subprocess()
-> % repr(args)[1:-1])
(Pdb)
and fails immediately after this with:
ERROR: Service 'plone' failed to build: The command '/bin/sh -c buildout -vvv -D' returned a non-zero code: 1
So, it is completely useless. I can't investigate the problem.
Any advice how to debug this issue?

Related

Dockerfile: `curl` command unable to save file

I'm building what I think is a simple dockerfile and have got one line in the code that is throwing an error.
# dockerfile
...
RUN curl -k --output bin/theta `curl -k 'https://mainnet-data.thetatoken.org/binary?os=linux&name=theta'`
RUN curl -k --output bin/thetacli `curl -k 'https://mainnet-data.thetatoken.org/binary?os=linux&name=thetacli'`
RUN curl -k --output guardian_mainnet/node/config.yaml `curl -k 'https://mainnet-data.thetatoken.org/config?is_guardian=true'`
...
The first two curl commands run without any issue. The third curl command throws an error:
Warning: Failed to create the file guardian_mainnet/node/config.yaml: No such file or directory
The directory is created and does exist. The prior two curl commands use exactly the same format and result in both the theta and thetacli files being created.
I've actually setup a docker container with the base image predicated on the FROM for this dockerfile. From there I've run the code in the dockerfile line-by-line and it has executed without any problem (including the third line). In other words, if I manually run the dockerfile commands from the CLI for the base container it works - it's only when building the container from the dockerfile at the host level that the error is thrown.
The only differences are (i) the file type of .yaml and (ii) the ? in the https link. But I've found nothing that says that would be a problem. [I've tried saving without the extension and it didn't make a difference.]
What am I missing?

Installing superset on docker: /bin/sh -c /frontend-mem-nag.sh & cc /app/superset-frontend && npm ci' return a non-zero code:127

When I am installing superset on docker with the command docker-compose up.
It reaches state 13/37 and show following error.
Step 13/37 : RUN /frontend-mem-nag.sh && cd /app/superset-frontend && npm ci
---> Running in f7b92bd8222e
: No such file or directory
ERROR: Service 'superset' failed to build: The command '/bin/sh -c /frontend-mem-nag.sh
&& npm ci' returned a non-zero code: 127
How can I fix this?
You might have resolved this, but I struggled with the same problem today so maybe someone else needs the answer.
If you are building the superset docker image on Windows and the target containers/VM are Linux based you will get the same error:
/bin/sh -c /frontend-mem-nag.sh & cc /app/superset-frontend && npm ci' return a non-zero code:127
The problem appears in the .sh script because when you do git checkout/clone it automatically changes the line ending of the file to CRLF and docker tries to execute with the same line endings.
Solution:
change the line endings to LF (use notepad++) and run the build command again.
source: thread for different project with similar problem

Error while building Docker image for Druid

I am doing this tutorial to load batch data using Apache Hadoop and I try to run this command to build a Docker image named "druid-hadoop-demo" with version tag "2.8.5" :
docker build -t druid-hadoop-demo:2.8.5 .
but it gives me this error
Step 14/53 : RUN curl -s https://archive.apache.org/dist/hadoop/core/hadoop-2.8.3/hadoop-2.8.3.tar.gz | tar -xz -C /usr/local/
---> Running in 7baa699ccc29
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
The command '/bin/sh -c curl -s https://archive.apache.org/dist/hadoop/core/hadoop-2.8.3/hadoop-2.8.3.tar.gz | tar -xz -C /usr/local/' returned a non-zero code: 2
Any help is appreciated.
That's a network error, indicating the file you downloaded was either corrupted in transit (it downloaded correctly for me, so unlikely to be the source), or the connection was dropped before finishing the curl command. Check for network proxies, intermittent network failures, or anything else that could interrupt the connection. You can also try to manually run curl from within a container to see if it's successful, e.g.
curl -o hadoop.tgz https://archive.apache.org/dist/hadoop/core/hadoop-2.8.3/hadoop-2.8.3.tar.gz
tar -tvzf hadoop.tgz

Non zero code returned when installing project docker ubuntu

I tried to install a project from docker and after running the command:
docker-compose -f docker-compose.yml up -d --build
at step 5 I'm receiving a Connection timed out saying:
curl: (7) Failed to connect to download.icu-project.org port 80: Connection timed out
ERROR: Service 'app' failed to build: The command '/bin/sh -c curl -sS -o /tmp/icu.tar.gz -L http://download.icuproject.org/files/icu4c/60.1/icu4c-60_1-src.tgz && tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install' returned a non-zero code: 7
I tried running into bash, but when I type 'docker-compose ps' I got no containers so I don't know how to properly fix this.
Have any of you encounter this issue and want to share with me ?
As is evident from the ERROR, the url that's being accessed as part of the docker-compose i.e. http://ftp.lfs-matrix.net/pub/blfs/conglomeration/icu/icu4c-60_1-src.tgz is inaccessible which is why the docker-compose fails with timeout. You can try accessing the URL from the browser and yes its unreachable.
You must change it to something else something like http://ftp.lfs-matrix.net/pub/blfs/conglomeration/icu/. While you do that please make sure that you are indeed downloading the zip from a reliable source.

oh-my-zsh installation returns non zero code

I'm trying to install oh-my-zsh as part of a Docker build (using a Dockerfile). Here's the dockerfile line in question:
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh`
and the error I get is:
The command [/bin/sh -c wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh] returned a non-zero code: 1
Full error gist here
To debug, I've run the command manually and it works. Did anyone have luck installing oh-my-zsh as part of a docker build? any idea why it behaves differently if run this way?
Build failing because install.sh return non zero code, when you execute script manually you are ignoring return code, but docker failing build. Usually non-zero return code indicate error, but if in this case everything ok you could ignore this error:
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true

Resources