2017-02-21

Slitaz64 -- slitaz/slitaz-ssh


slitaz/slitaz-ssh
https://hub.docker.com/r/slitaz/slitaz-ssh/

docker pull slitaz/slitaz-ssh

openssh client/server
ID/PASSWD : root/root


1.
tux@slitaz:~$ docker run --help | egrep '\-d,|\-P,'
-d, --detach Run container in background and print container ID
-P, --publish-all Publish all exposed ports to random ports

tux@slitaz:~$ docker run -d -P slitaz/slitaz-ssh
Unable to find image 'slitaz/slitaz-ssh:latest' locally
latest: Pulling from slitaz/slitaz-ssh
986f76552751: Pull complete
0226342fb824: Pull complete
c506367a6559: Pull complete
babe5d634668: Pull complete
Digest: sha256:b159db8c7371602c7609cfc04e752d5a3ea4610bef57b76c75174b76d67fca8b
Status: Downloaded newer image for slitaz/slitaz-ssh:latest
b32fc1ef623c43363871ddef19b3622c445f0ad9211bc31833ae17701c9cbb65


2.
tux@slitaz:~$ docker ps
CONTAINER ID        IMAGE               COMMAND               CREATED             STATUS              PORTS                   NAMES
b32fc1ef623c        slitaz/slitaz-ssh   "/usr/sbin/sshd -D"   12 seconds ago      Up 11 seconds       0.0.0.0:32768->22/tcp   tender_curie

tux@slitaz:~$ docker inspect b32f | grep IPAd
            "SecondaryIPAddresses": null,
            "IPAddress": "172.17.0.2",
                    "IPAddress": "172.17.0.2",


3.
tux@slitaz:~$ ssh root@172.17.0.2
Host '172.17.0.2' is not in the trusted hosts file.
(ecdsa-sha2-nistp256 fingerprint md5 4e:89:a7:c0:69:64:12:13:72:d6:af:18:53:af:e1:89)
Do you want to continue connecting? (y/n) y
root@172.17.0.2's password:
Welcome to the Open Source World!
SliTaz GNU/Linux is distributed in the hope that it will be useful,
but with ABSOLUTELY NO WARRANTY.


4.
root@b32fc1ef623c:~# tazpkg -l
List of all installed packages
================================================================================
busybox                            1.23.2            base-system
gettext-base                       0.19.4            base-system
glibc-base                         2.19              base-system
libcrypto                          1.0.1q            security
ncurses-common                     5.9               base-system
openssh                            7.2p2             security
sftp-server                        7.2p2             security
slitaz-base-files                  309               base-system
tazpkg                             5.3.3             base-system
zlib                               1.2.8             base-system
================================================================================
10 packages installed.

root@b32fc1ef623c:~#

Slitaz64 -- Docker Dockerfile

Docker Dockerfile
 
Public | Automated Build
slitaz/slitaz-ssh

https://hub.docker.com/r/slitaz/slitaz-ssh/~/dockerfile/
https://github.com/alanyih/slitaz-ssh/blob/master/Dockerfile


Dockerfile
FROM slitaz/slitaz-base:latest 

RUN tazpkg -gi openssh && \
 tazpkg -cc

RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
 sed -i 's/#PasswordAuthentication/PasswordAuthentication/' /etc/ssh/sshd_config 

RUN mkdir -p /var/run/sshd

EXPOSE 22/tcp 

CMD ["/usr/sbin/sshd", "-D"]

Logs
https://hub.docker.com/r/slitaz/slitaz-ssh/builds/b2dk4xcv73ytqk8tzvypq5t/
Building in Docker Cloud's infrastructure...
Cloning into '.'...
KernelVersion: 4.4.0-59-generic
Os: linux
BuildTime: 2017-01-10T23:09:49.630531934+00:00
ApiVersion: 1.24
Version: 1.12.6-cs6
GitCommit: 712e864
Arch: amd64
GoVersion: go1.6.4
Starting build of index.docker.io/slitaz/slitaz-ssh:latest...
Step 1 : FROM slitaz/slitaz-base:latest
---> 50236ce3c843
Step 2 : RUN tazpkg -gi openssh && tazpkg -cc
---> Running in 04af6e5b65f6
[..]