Created
March 20, 2018 11:52
-
-
Save jstangroome/1d75fd5577c58c5cd651b8443b6e98c3 to your computer and use it in GitHub Desktop.
Build lslocks for Ubuntu Trusty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
RUN apt-get update | |
RUN apt-get build-dep --assume-yes \ | |
util-linux | |
RUN apt-get install --assume-yes \ | |
wget \ | |
gnupg | |
WORKDIR /src | |
RUN wget \ | |
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.22/util-linux-2.22.2.tar.gz \ | |
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.22/util-linux-2.22.2.tar.sign | |
# v2.22 is when lslocks was introduced. Trusty has 2.20.1. Newest versions have too many dependencies. | |
RUN gunzip util-linux-2.22.2.tar.gz | |
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys EC39C284 | |
RUN gpg --verify util-linux-2.22.2.tar.sign | |
RUN tar -xf util-linux-2.22.2.tar | |
WORKDIR /src/util-linux-2.22.2 | |
RUN grep -o -e '--disable-[a-z-]*' configure.ac | \ | |
xargs -t ./configure | |
# Configure with every option disabled. Still builds lslocks. | |
RUN make | |
RUN make install | |
WORKDIR / | |
CMD ["tar", "-c", "usr/bin/lslocks", "usr/share/man/man8/lslocks.8"] | |
# Usage: docker build -t lslocks . && docker run --rm lslocks | tar -x | |
# TODO use multi-stage docker for put just the resulting tar in final image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment