adding alping dockersz

This commit is contained in:
christalib 2020-05-03 20:22:16 +02:00
parent 7136bd260a
commit 030ed26178
2 changed files with 54 additions and 0 deletions

22
alpine_dockerz/Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM alpine:latest
ARG USER
ARG USER_PASSWORD
RUN apk update && apk upgrade && apk add alpine-sdk wget cmake coreutils bash openssh tmux git curl nmap john nano gcc python3 python
RUN adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D $USER
RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& mkdir /packages \
&& chown $USER:abuild /packages \
&& mkdir -p /var/cache/apk \
&& ln -s /var/cache/apk /etc/apk/cache
RUN apk add binwalk --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing
RUN echo "${USER}:${USER_PASSWORD}" | chpasswd
RUN rm -rf /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
RUN ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
RUN mkdir -p /var/run/sshd
ADD motd /etc/motd
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

View file

@ -0,0 +1,32 @@
---
version: "3"
services:
alice:
build:
context: .
dockerfile: Dockerfile
args:
- "USER=alice"
- "USER_PASSWORD=<CHANGEME>"
ports:
- "9001:22"
bob:
build:
context: .
dockerfile: Dockerfile
args:
- "USER=bob"
- "USER_PASSWORD=<CHANGEME>"
ports:
- "9002:22"
chris:
build:
context: .
dockerfile: Dockerfile
args:
- "USER=chris"
- "USER_PASSWORD=<CHANGEME>"
ports:
- "9003:22"