Basic Virtual Private Server base on Alpine, accessible via SSH
3.2K
This image provides a VPS, accessible over SSH, based on Alpine Linux.
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"]
$ cd /path/to/dir/containing/Dockerfile
$ docker build -t lyderic/vps --build-arg sshuser=foo \
--build-arg sshpassword=bar .
$ 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
$ docker exec -it vps sh
$ ssh -p 12345 -l foo <docker-host>
Content type
Image
Digest
Size
4.6 MB
Last updated
over 9 years ago
docker pull lyderic/vps