update base image to minimize image size

This commit is contained in:
newnius 2017-07-18 21:27:08 +08:00
parent 1a8c9bb3ff
commit 9b87b97752
3 changed files with 27 additions and 4 deletions

View File

@ -1,9 +1,13 @@
FROM ubuntu
RUN apt update \
&& apt install -y openssh-server
FROM alpine:3.6
MAINTAINER Newnius <docker@newnius.com>
RUN apk add --no-cache openssh
RUN ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
RUN cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ADD bootstrap.sh /etc/bootstrap.sh
CMD ["bash", "/etc/bootstrap.sh"]

8
docker-proxy/README.md Normal file
View File

@ -0,0 +1,8 @@
```bash
docker service create \
--replicas 1 \
--name proxy_docker \
--network swarm-net \
-p 7001:7001 \
newnius/docker-proxy
```

View File

@ -1,4 +1,15 @@
#! /bin/bash
/etc/init.d/ssh start
# from https://github.com/danielguerra69/alpine-sshd
if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; then
# generate fresh rsa key
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
fi
if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; then
# generate fresh dsa key
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
fi
/etc/init.d/sshd start
ssh -t -t -D 0.0.0.0:7001 -o StrictHostKeyChecking=no localhost