Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker out of memory crash (32 bit binary used) #2149

Closed
klauspost opened this issue Jan 2, 2016 · 7 comments
Closed

Docker out of memory crash (32 bit binary used) #2149

klauspost opened this issue Jan 2, 2016 · 7 comments

Comments

@klauspost
Copy link
Contributor

It seems like the Docker image uses a 32 bit ipfs binary.

This causes out-of-memory crashes when I import many files at once, for instance: crash.txt.

Is there any reason for not using a 64 bit binary?

@klauspost
Copy link
Contributor Author

@Luzifer - do you remember why you chose the 32 bit executable?

@Luzifer
Copy link
Member

Luzifer commented Jan 6, 2016

Because the 64bit binary didn't work in the docker container on all of my test systems… (Until today I'm putting 32bit binaries into containers because of the 64bit binaries are failing to start)

Just tried again:

# docker run --rm -ti -v ~/tmp/ipfs:/data/ipfs ipfs64
/usr/local/bin/start_ipfs: line 11: /usr/local/bin/ipfs: No such file or directory
Running ...
/usr/local/bin/start_ipfs: line 16: /usr/local/bin/ipfs: No such file or directory
/usr/local/bin/start_ipfs: line 17: /usr/local/bin/ipfs: No such file or directory
/usr/local/bin/start_ipfs: line 18: /usr/local/bin/ipfs: No such file or directory
/usr/local/bin/start_ipfs: line 21: /usr/local/bin/ipfs: No such file or directory

Change used for this test:

diff --git a/Dockerfile b/Dockerfile
index 88a8bf4..4106339 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,10 +15,10 @@ ADD bin/container_shacheck /usr/local/bin/shacheck
 RUN adduser -D -h /data -u 1000 ipfs \
  && mkdir -p /data/ipfs && chown ipfs:ipfs /data/ipfs \
  && apk add --update bash curl wget ca-certificates zip \
- && wget https://gobuilder.me/get/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs_${VERSION}_linux-386.zip \
- && /bin/bash /usr/local/bin/shacheck ${VERSION} ipfs_${VERSION}_linux-386.zip \
- && unzip ipfs_${VERSION}_linux-386.zip \
- && rm ipfs_${VERSION}_linux-386.zip \
+ && wget https://gobuilder.me/get/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs_${VERSION}_linux-amd64.zip \
+ && /bin/bash /usr/local/bin/shacheck ${VERSION} ipfs_${VERSION}_linux-amd64.zip \
+ && unzip ipfs_${VERSION}_linux-amd64.zip \
+ && rm ipfs_${VERSION}_linux-amd64.zip \
  && mv ipfs/ipfs /usr/local/bin/ipfs \
  && chmod 755 /usr/local/bin/start_ipfs \
  && apk del wget zip curl

@Kubuxu
Copy link
Member

Kubuxu commented Jan 7, 2016

It looks like ipfs might be missing some lib. Can you run 'ldd /usr/local/bin/ipfs' in the container?

@klauspost
Copy link
Contributor Author

I seems like all gobuilder builds are failing: https://gobuilder.me/github.com/ipfs/go-ipfs leaving only empty files. My guess is that even the 32 bit build is broken ATM.

@Kubuxu
Copy link
Member

Kubuxu commented Jan 7, 2016

Or that. I've heard hoofbeets and thought of zebras instead of horses.

@Luzifer
Copy link
Member

Luzifer commented Jan 7, 2016

@klauspost You should look at https://gobuilder.me/github.com/ipfs/go-ipfs/cmd/ipfs - There you will find the binaries used for the container.

LDD:

> docker run --rm -ti --entrypoint=/bin/bash ipfs64
bash-4.3$ ldd /usr/local/bin/ipfs
    /lib64/ld-linux-x86-64.so.2 (0x562e4880b000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x562e4880b000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x562e4880b000)
bash-4.3$ /usr/local/bin/ipfs
bash: /usr/local/bin/ipfs: No such file or directory
bash-4.3$

Edit1: Found the reason: https://github.com/gliderlabs/docker-alpine/blob/master/docs/caveats.md (Even when we're not using the alpine build of gliderlabs this seems to be true for us too…)

Edit2: Looks like setting a env variable during build could solve this… http://blog.xebia.com/create-the-smallest-possible-docker-container/

Edit3: Found a solution working on gobuilder:

> docker run --rm -ti --entrypoint=/bin/bash 20c98f4608e6
bash-4.3$ ldd /usr/local/bin/ipfs_static
ldd: /usr/local/bin/ipfs_static: Not a valid dynamic program
bash-4.3$ /usr/local/bin/ipfs_static
USAGE:

    ipfs - global p2p merkle-dag filesystem

    ipfs [<flags>] <command> [<arg>] ...

Edit4: Opened a PR proposal

@whyrusleeping
Copy link
Member

I think this has since been resolved. If not, its very likely not a problem anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants