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

Use alpine for docker image base & pre-install bind-utils for debugging failures #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

karlkfi
Copy link
Contributor

@karlkfi karlkfi commented Mar 19, 2016

@lloesche What do you think about this? It includes a bunch of tools to make debugging easier (nsupdate, nslookup, host, dig, delv).

@karlkfi
Copy link
Contributor Author

karlkfi commented Mar 19, 2016

I'm not sure what side-effects this has, with musl instead of glibc. Tho since it's statically compiled I'm hoping it doesn't interact.

Another benefit of using alpine (more than just having bind-utils) is that having a package manager allows for installing new packages for debugging other production failures.

@@ -1,4 +1,5 @@
FROM scratch
FROM alpine:3.3
ADD mesos-dns_rootfs.tar.gz /
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tarball would need to be adjusted then as well. Otherwise it will overwrite files like

/etc/group
/etc/hostname
/etc/hosts
/etc/nsswitch.conf
/etc/passwd
/etc/resolv.conf
/lib64/ld-linux-x86-64.so.2
/lib64/libc.so.6
/lib64/libnss_compat.so.2
/lib64/libnss_dns.so.2
/lib64/libnss_files.so.2
/lib64/libpthread.so.0

which I add to the rootfs tarball that's being generated by the docker-rootfs target. The assembly of the tarball is done in common/Makefile.

@karlkfi
Copy link
Contributor Author

karlkfi commented Mar 19, 2016

So worst case, the alpine install is kinda borked and the bind utils don't work as expected, but mesos-dns works fine because the tarball brings all its dependencies?

@lloesche
Copy link
Contributor

Maybe it would make sense to build mesos-dns inside an alpine container then as well? Like, build it in a alpine 'junk' container like I'm using for the other build targets and then add the resulting binary to a clean alpine based image using a COPY. That way the number of layers stays minimal resulting in a smaller image transfer.

Easiest way I see to do that would be to change docker-rootfs/Dockerfile to be FROM alpine, adjust the RUN and COPY commands and the tarball assembly in common/Makefile for the docker-rootfs target.

@karlkfi
Copy link
Contributor Author

karlkfi commented Mar 19, 2016

That's definitely an option. I have no idea what side-effects there would be using musl tho.

@lloesche
Copy link
Contributor

Me neither, I've never worked with Alpine. My standard Docker containers are either FROM scratch or centos:7 😄

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 this pull request may close these issues.

None yet

2 participants