diff --git a/alpine_dockerz/Dockerfile b/alpine_dockerz/Dockerfile new file mode 100644 index 0000000..b7edc9c --- /dev/null +++ b/alpine_dockerz/Dockerfile @@ -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"] diff --git a/alpine_dockerz/docker-compose.yml b/alpine_dockerz/docker-compose.yml new file mode 100644 index 0000000..db706f8 --- /dev/null +++ b/alpine_dockerz/docker-compose.yml @@ -0,0 +1,32 @@ +--- +version: "3" +services: + alice: + build: + context: . + dockerfile: Dockerfile + args: + - "USER=alice" + - "USER_PASSWORD=" + ports: + - "9001:22" + + bob: + build: + context: . + dockerfile: Dockerfile + args: + - "USER=bob" + - "USER_PASSWORD=" + ports: + - "9002:22" + + chris: + build: + context: . + dockerfile: Dockerfile + args: + - "USER=chris" + - "USER_PASSWORD=" + ports: + - "9003:22"