1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

update Dockerfile

This commit is contained in:
Nicolas Viennot 2019-04-24 21:32:28 -04:00
parent b83ea046fc
commit b657cdf1e9

View File

@ -1,43 +1,31 @@
# tmate-ssh-server, see https://tmate.io/ FROM alpine:3.9
#
# Example usage:
#
# docker run --privileged --rm -i -p 22:22 \
# -v /etc/tmate/keys:/daemon-keys \
# -v /etc/tmate/authorized_keys:/authorized-keys \
# varac/tmate-ssh-server \
# /bin/sh -c "/sbin/tmate-ssh-server -k /daemon-keys -a /authorized-keys -b 0.0.0.0 -p 22 -v -v -v -h SERVER_FQDN"
FROM debian:jessie-slim RUN apk add --no-cache msgpack-c ncurses-libs libevent libexecinfo libressl zlib
# Locales RUN set -ex; \
RUN mkdir -p /usr/share/locale/locale.alias && ln -s /etc/locale.alias /usr/share/locale/locale.alias apk add --no-cache --virtual .build-deps \
RUN apt-get update && apt-get install -y locales \ git wget cmake make gcc g++ linux-headers zlib-dev libressl-dev \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 automake autoconf libevent-dev ncurses-dev msgpack-c-dev libexecinfo-dev; \
ENV LANG en_US.utf8 \
mkdir -p /src/libssh/build; \
cd /src; \
wget -O libssh.tar.xz https://www.libssh.org/files/0.8/libssh-0.8.7.tar.xz; \
tar -xf libssh.tar.xz -C /src/libssh --strip-components=1; \
cd /src/libssh/build; \
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DWITH_SFTP=OFF ..; \
make -j "$(nproc)"; \
make install ;\
\
mkdir -p /src/; \
cd /src/; \
git clone https://github.com/tmate-io/tmate-ssh-server.git; \
cd tmate-ssh-server; \
./autogen.sh; \
./configure --prefix=/usr CFLAGS="-D_GNU_SOURCE"; \
make -j "$(nproc)"; \
make install ;\
rm -rf /src; \
apk del .build-deps
RUN apt-get install -y git build-essential automake cmake pkg-config libssl-dev zlib1g-dev libevent-dev libncurses5-dev \ EXPOSE 22
&& rm -rf /var/lib/apt/lists/* ENTRYPOINT ["tmate-ssh-server"]
RUN mkdir /src && cd /src/ &&\
# Latest libssh requires cmake >= 3.3.0 which is not available in jessie.
# jessie-backports provides 3.6.2 but this pulls too many dependencies in.
git clone -b libssh-0.7.6 git://git.libssh.org/projects/libssh.git &&\
git clone https://github.com/msgpack/msgpack-c.git &&\
git clone https://github.com/tmate-io/tmate-ssh-server.git
RUN cd /src/libssh &&\
mkdir build && cd build && cmake .. && make install
RUN cd /src/msgpack-c &&\
mkdir build && cd build && cmake .. && make install
RUN cd /src/tmate-ssh-server &&\
sh autogen.sh && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure && make
RUN cp /src/tmate-ssh-server/tmate-ssh-server /sbin/
# Clean up
RUN rm -rf /src
RUN apt-get --auto-remove purge -y git build-essential automake cmake pkg-config libssl-dev zlib1g-dev libncurses5-dev
ENV LD_LIBRARY_PATH=/usr/local/lib