Created
October 19, 2018 08:39
-
-
Save leophys/6b1ac8cad9b2c491a5fc545a6c67878d to your computer and use it in GitHub Desktop.
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 debian:stretch | |
ARG UID=1000 | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV TARGETDIR="/home/builder/target" | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
build-essential \ | |
curl \ | |
wget \ | |
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | |
&& useradd -m -u $UID builder | |
USER builder | |
WORKDIR /home/builder | |
RUN wget https://gist.githubusercontent.com/leophys/4409d02d68e1db0b5e651204eb89ad9d/raw/300057e89223b85684b796599a35657df54df1f7/build-tmux.sh \ | |
&& chmod +x build-tmux.sh | |
ENTRYPOINT ["/home/builder/build-tmux.sh"] | |
CMD ["1"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To build a static-linked version of
tmux
in a container (to obtain a portable version of tmux).Build the image
docker build -t tmux-builder .
Compile with
First create a
target
directory on your hostThen run the build, mounting the target directory on the container
docker run -v $PWD/target:/home/builder/target tmux-builder
If you want to speed things up, append an integer roughly the number of your cpus at the end of the previous command.