dtn7 / dtn7-rs

Rust implementation of a DTN based on RFC 9171
Other
81 stars 20 forks source link

Error when running dtnd -h command on docker instance #28

Closed ghost closed 2 years ago

ghost commented 2 years ago

root@102d85e79c4b:~# dtnd -h

dtnd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by dtnd)

dtnd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by dtnd

dtnd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by dtnd)

gh0st42 commented 2 years ago

which base image did you use? for debian and ubuntu the provided gnu binaries should work, on alpine the musl version might be a better fit.

can you provide a docker file to reproduce the issue?

building dtnd by hand should always give a working binary on any system.

the prebuild binaries for amd64 GNU platforms are built on ubuntu 18.04. to avoid glibc issue you could try the musl version, e.g., https://github.com/dtn7/dtn7-rs/releases/download/v0.18.0/dtn7-0.18.0-x86_64-unknown-linux-musl.tar.gz

ghost commented 2 years ago

which base image did you use? for debian and ubuntu the provided gnu binaries should work, on alpine the musl version might be a better fit.

can you provide a docker file to reproduce the issue?

building dtnd by hand should always give a working binary on any system.

the prebuild binaries for amd64 GNU platforms are built on ubuntu 18.04. to avoid glibc issue you could try the musl version, e.g., https://github.com/dtn7/dtn7-rs/releases/download/v0.18.0/dtn7-0.18.0-x86_64-unknown-linux-musl.tar.gz

I am using Ubuntu 22.04. How can I provide you the docker file?

gh0st42 commented 2 years ago

You can post a minimal Dockerfile using code markdown here to reproduce the problem.

have you tried the musl build for x64 or building from source in the Dockerfile? This should definitely work.

gh0st42 commented 2 years ago

The binary releases work perfectly fine on Ubuntu 20.04 and 22.04 in Docker:

FROM ubuntu:22.04

WORKDIR /root
RUN apt-get update && \
  apt-get install -y wget && \
  wget https://github.com/dtn7/dtn7-rs/releases/download/v0.18.0/dtn7-0.18.0-x86_64-unknown-linux-gnu.tar.gz && \
  tar xvf dtn7* && \
  rm -rf /var/lib/apt/lists/*

CMD ["/root/dtn7-0.18.0/bin/dtnd", "-h"]

As the above sample works and the alternatives such as the musl binaries or building from source also work reliably in Dockerfiles, I will close the issue for now.

ghost commented 2 years ago

I have not tried musl build for x64. Where can I find the instructions for building it using the musl build. I have been following your getting started guide: https://github.com/dtn7/dtn7-rs/blob/master/doc/getting-started.md. What do you mean by building the source in the Dockerfile?

gh0st42 commented 2 years ago

Instead of performing the build step from the getting started guide, you can also just download a release from the github homepage and copy the needed binaries to /tmp/shared and continue with the other instructions.

ghost commented 2 years ago

Instead of performing the build step from the getting started guide, you can also just download a release from the github homepage and copy the needed binaries to /tmp/shared and continue with the other instructions.

Thank you, it is working now.