Dockerfile with sshd server and nginx. Forked from viliusl/docker-sshd-nginx to apply best practices
1.1K
Dockerfile for building docker container with passwordless sshd server and nginx serving static page. This is mostly a template for creating more useful docker images.
This repository contains all needed resources to build a docker image with following features:
For convenience there is a ./manage.sh command for building, starting (with proper port mappings), stopping and connecting via ssh.
Mainly to apply best practices in order to optimize the building process and the resulting size of the image
As a matter of fact it proved to reduce the image size by a mere 45 Mb (based on ubuntu/precise) for what it's worth.
| REPOSITORY | TAG | IMAGE ID | CREATED | SIZE |
|---|---|---|---|---|
| fxmartin/ubuntu-sshd-nginx | latest | 3f48e0953b35 | About an hour ago | 270.4 MB |
| fxmartin/ubuntu-sshd-nginx-precise | latest | 349d75c7471c | 48 minutes ago | 214.9 MB |
| viliusl/ubuntu-sshd-nginx | latest | bae0d68cf679 | 22 months ago | 259.1 MB |
You can download this image from public Docker Registry. A bash script is provided: manage.sh, which allows to manage the container, considering that it won't stop by itself due to supervisor daemon:
Run using command:
docker run -d -p 55522:22 -p 55580:80 fxmartin/ubuntu-sshd-nginx
or
manage.sh start
Connect via ssh:
manage.sh ssh
Image 1 - nginx welcome page

Image 2 - supervisord web ui to manage processes

Just don't forget to add private key (yeah, I know) from ssh_keys folder to you '~/.ssh/' and add it via
ssh-add -K ~/.ssh/id_rsa_docker
Removed docker calls via sudo as it is not best practice for a local docker installation.
Forked from viliusl/docker-sshd-nginx
Content type
Image
Digest
Size
104.2 MB
Last updated
over 10 years ago
docker pull fxmartin/docker-sshd-nginx