GNU Screen Vs Tmux: Size in Docker Container

A Small Experiment

I was interested to see which terminal emulator - gnu screen or tmux used less space. I had assumed it was screen since tmux requires the install and configuration of locales to function. But before I rewrote all my bash scripts I decided to experiment. TLDR: the tmux container is larger by 15-16 MB. Not enough of a difference for me to change.

The Dockerfiles

Below are the two dockerfiles I used. Both identical except for the tmux or screen installs.

Tmux Dockerfileview raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM debian:stretch

RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get -y upgrade && \
apt-get -y --no-install-recommends install \
curl less ca-certificates nano

RUN mkdir /var/www/ && \
useradd -m -s /bin/bash user && \
echo 'user:pass' | chpasswd

USER user

WORKDIR /home/user

RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
nvm install node

USER root

RUN DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends install \
tmux locales

RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
echo "LANG=en_US.UTF-8" > /etc/locale.conf && \
locale-gen en_US.UTF-8

CMD tmux new -s "devnull" -d "/bin/bash" && \
tmux run-shell -t "devnull:0" "tail -f /dev/null"

## EXPOSE PORTS IN DOCKER-COMPOSE
Screen Dockerfileview raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM debian:stretch

RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get -y upgrade && \
apt-get -y --no-install-recommends install \
curl less ca-certificates nano

RUN mkdir /var/www/ && \
useradd -m -s /bin/bash user && \
echo 'user:pass' | chpasswd

USER user

WORKDIR /home/user

RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
nvm install node

USER root

RUN DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends install \
screen

CMD /bin/bash

The Result

As I said tmux is slightly larger.

Not enough to make a difference for me. Thank goodness!