Skip to content

Instantly share code, notes, and snippets.

@mayli
Created May 6, 2019 20:37
Show Gist options
  • Save mayli/fa6614e4edfb92bd7d1edc6f164c5e19 to your computer and use it in GitHub Desktop.
Save mayli/fa6614e4edfb92bd7d1edc6f164c5e19 to your computer and use it in GitHub Desktop.
mosh static alpine docker
FROM alpine:latest
MAINTAINER Brett Randall <javabrett@gmail.com>
# NOTE: openssh is only required for testing connection to built docker using the built mosh-server
RUN apk update \
&& apk add alpine-sdk autoconf automake protobuf-dev ncurses ncurses-dev ncurses-static openssl-dev openssh
RUN apk add perl-doc
RUN git clone https://github.com/mobile-shell/mosh.git \
&& cd mosh \
&& ./autogen.sh \
&& LDFLAGS="-static" ./configure --prefix=/usr \
&& make \
&& make install \
&& ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa \
&& ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa \
&& adduser -D mosh \
&& echo 'mosh:m0sh-st@t1c' | chpasswd
EXPOSE 22
ENTRYPOINT /usr/sbin/sshd \
&& sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment