Sign inSign up

lyderic/vps

By lyderic

Updated over 9 years ago

Basic Virtual Private Server base on Alpine, accessible via SSH

Image
0

3.2K

lyderic/vps repository overview

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

Dockerfile:
FROM alpine
MAINTAINER lyderic <[email protected]>

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 --hostname=vps.lyderic.com \
-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>

Tag summary

Content type

Image

Digest

Size

4.6 MB

Last updated

over 9 years ago

docker pull lyderic/vps