Public Repository

Last pushed: a year ago
Short Description
Basic Virtual Private Server base on Alpine, accessible via SSH
Full Description

This image provides a VPS, accessible over SSH, based on Alpine Linux.


FROM alpine
MAINTAINER lyderic <>

ARG sshuser
ARG sshpassword

RUN apk update
RUN apk upgrade

RUN apk add openssh
RUN ssh-keygen -t rsa     -N "" -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t dsa     -N "" -f /etc/ssh/ssh_host_dsa_key
RUN ssh-keygen -t ecdsa   -N "" -f /etc/ssh/ssh_host_ecdsa_key
RUN ssh-keygen -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key

RUN adduser -D $sshuser
RUN echo "$sshuser:$sshpassword" | chpasswd

RUN echo '::sysinit:/sbin/syslogd' > /etc/inittab
RUN echo '::sysinit:/usr/sbin/sshd' >> /etc/inittab

ENTRYPOINT ["/sbin/init"]

How to build:

$ cd /path/to/dir/containing/Dockerfile
$ docker build -t lyderic/vps --build-arg sshuser=foo \
--build-arg sshpassword=bar .

How to run:

$ docker run -d --restart=always --name=vps \
-v /path/to/local/dir:/path/to/dir/in/vps -p 12345:22 lyderic/vps

How to connect locally:

$ docker exec -it vps sh

How to connect remotely:

$ ssh -p 12345 -l foo <docker-host>
Docker Pull Command