"No such file or directory" on Alpine Linux container

1,659 views
Skip to first unread message

Geoff Hicks

unread,
Feb 27, 2015, 12:45:23 AM2/27/15
to consu...@googlegroups.com
Hi, I'm trying to use Consul in a Docker container, based on this minimalist Alpine Linux image: https://github.com/gliderlabs/docker-alpine. The image builds fine, but when I try to run consul inside it I get "No such file or directory".

If I use the "ubuntu" base image with the same Dockerfile, it runs with no issues - I'm assuming there's some library that Consul has a dependency on which isn't in the docker-alpine base image.

I can't seem to find anything in the docs explaining what components or libraries Consul actually requires for execution. Is there any way we could get a list posted?


This e-mail, including attachments, contains confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. The reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

Armon Dadgar

unread,
Feb 27, 2015, 4:29:20 PM2/27/15
to Geoff Hicks, consu...@googlegroups.com
Hey Geoff,

The Consul binaries are statically compiled, so they have relatively few external requirements.
I believe that libc is required for the binary to start, and the SSL root certificates are required
for many features (update checking, Atlas integration, SSL health checks). That should be it however!

Best Regards,
Armon Dadgar
This e-mail, including attachments, contains confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. The reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. --
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Geoff Hicks

unread,
Feb 28, 2015, 1:40:33 AM2/28/15
to consu...@googlegroups.com
Hi Armon, thanks for the quick reply. I investigated a little more using ldd, and it looks like Alpine Linux uses uclibc instead of glibc. For now I've just switched to the official Ubuntu image instead, but thought it would be a good idea to post this here for future reference.
--

Andy Gayton

unread,
Mar 4, 2015, 8:06:27 PM3/4/15
to consu...@googlegroups.com
We're exploring this too.

We use vagga for our containers, and have been using this config to build out Consul:


It works great, and the container size is 24Mb, 16.8M of which is the Consul bin.

An example dockerfile which does the same thing is:

https://registry.hub.docker.com/u/voxxit/consul/dockerfile/

The release of 0.5.0 highlights the need to be able to pin versions though. Relying on go get will always produce a container with the latest development version of Consul, whether you're ready to upgrade or not.

Thinking through options... 

Would it be possible to also provide Consul binary builds for musl /uclibc environment? Using vagga, it's particularly easy to setup a build environment to produce a binary. 

Alternatively, could Consul's build process introduce dependency pinning, so when you checkout and build a particularly Consul tag - you always pull in the same dependencies that Consul tag was intended to be built against?
Reply all
Reply to author
Forward
0 new messages