2018-04-28 19:03:56 +00:00
|
|
|
FROM alpine:3.7
|
|
|
|
LABEL maintainer "me@jowj.net"
|
|
|
|
|
2018-04-29 05:23:45 +00:00
|
|
|
ARG username=colove
|
|
|
|
ARG homedir=/home/$username
|
|
|
|
|
2018-04-28 19:03:56 +00:00
|
|
|
# make container livable
|
|
|
|
RUN apk update \
|
|
|
|
&& apk add \
|
|
|
|
bash bash-doc \
|
|
|
|
emacs-nox emacs-doc \
|
|
|
|
git git-doc \
|
|
|
|
gnupg gnupg-doc \
|
|
|
|
groff groff-doc \
|
|
|
|
iputils \
|
|
|
|
man man-pages \
|
|
|
|
openssh-client openssh-doc \
|
|
|
|
openssl openssl-doc \
|
|
|
|
python3 python3-doc \
|
|
|
|
sudo sudo-doc \
|
|
|
|
tmux tmux-doc \
|
|
|
|
&& python3 -m pip install \
|
|
|
|
awscli \
|
|
|
|
&& apk add \
|
|
|
|
gcc \
|
|
|
|
linux-headers \
|
|
|
|
make \
|
|
|
|
musl-dev \
|
|
|
|
python2-dev \
|
|
|
|
python3-dev \
|
|
|
|
libffi-dev \
|
|
|
|
openssl-dev
|
|
|
|
|
|
|
|
# install more specific applications
|
|
|
|
RUN apk add \
|
|
|
|
nmap nmap-doc \
|
|
|
|
ansible ansible-doc \
|
|
|
|
&& python3 -m ensurepip \
|
|
|
|
&& python3 -m pip install --upgrade pip \
|
|
|
|
&& python3 -m pip install \
|
|
|
|
ansible
|
2018-04-29 05:23:45 +00:00
|
|
|
|
|
|
|
# configure a user
|
|
|
|
RUN addgroup -S "$username" \
|
2018-05-03 16:55:34 +00:00
|
|
|
&& adduser -S -G "$username" -s /bin/bash "$username"
|
2018-05-02 02:19:23 +00:00
|
|
|
|
2018-05-02 02:18:59 +00:00
|
|
|
# ARG enablesudo="true"
|
|
|
|
# RUN if test "$enablesudo"; then true \
|
|
|
|
# && echo "ENABLING PASSWORDLESS SUDO" >&2 \
|
|
|
|
# && echo "sudo should only be enabled in development, since root privs in your container can probably be leveraged to root privs on your host" >&2 \
|
|
|
|
# && echo "$username ALL=(ALL) NOPASSWD: ALL" > "/etc/sudoers.d/$username" \
|
|
|
|
# && chmod 0440 "/etc/sudoers.d/$username" \
|
|
|
|
# ; fi
|
2018-04-29 05:23:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
USER $username
|
|
|
|
WORKDIR $homedir
|
2018-04-28 19:03:56 +00:00
|
|
|
CMD /bin/bash -i
|