Initial commit.

master
Icedream 2017-02-15 08:17:52 +01:00
commit 957a2fb654
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
5 changed files with 79 additions and 0 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
Dockerfile*
.dockerignore
docker-compose*
.git*

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
#FROM openjdk:8-jre-alpine
FROM alpine:edge
RUN apk add --no-cache openjdk8-jre-base docker openssl openssh tar gzip xz bzip2
ADD container-init.sh /usr/local/bin/init
ENTRYPOINT [ "init" ]
EXPOSE 22

12
Dockerfile.armhf Normal file
View File

@ -0,0 +1,12 @@
FROM container4armhf/armhf-alpine:edge
RUN echo "http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --no-cache openjdk8-jre-base docker openssl openssh tar gzip xz bzip2 &&\
update-ca-certificates
ADD container-init.sh /usr/local/bin/init
ENTRYPOINT [ "init" ]
EXPOSE 22

21
container-init.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh -e
mkdir -p ~root/.ssh
chmod 700 ~root/.ssh
if [ -f "/authorized_keys" ]; then
# use mounted-in authorized_keys
cp -v /authorized_keys ~root/.ssh/authorized_keys
chmod 600 ~root/.ssh/authorized_keys
elif [ ! -z "$1" ]; then
# download authorized_keys from http server
wget -q -O ~root/.ssh/authorized_keys "$1"
chmod 600 ~root/.ssh/authorized_keys
shift 1
fi
# generate host keys if they don't exist yet
ssh-keygen -A
# start ssh server
exec "$(which sshd)" -D -e -p 22 "$@"

30
docker-compose.yml Normal file
View File

@ -0,0 +1,30 @@
version: "2"
services:
daemon-armhf:
restart: always
build:
context: .
dockerfile: Dockerfile.armhf
ports:
- "2222:22"
volumes:
- /tmp/:/tmp/
- /var/run/docker.sock:/var/run/docker.sock
- /var/tmp/jenkins-slave:/var/tmp/jenkins-slave
#- ./authorized_keys:/authorized_keys:ro
#command:
# - http://url.to/your/authorized_keys
daemon:
restart: always
build:
context: .
ports:
- "2222:22"
volumes:
- /tmp/:/tmp/
- /var/run/docker.sock:/var/run/docker.sock
- /var/tmp/jenkins-slave:/var/tmp/jenkins-slave
#- ./authorized_keys:/authorized_keys:ro
#command:
# - http://url.to/your/authorized_keys