-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
60 lines (48 loc) · 1.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Developer:
# ---------
# Name: Maik Ellerbrock
#
# GitHub: https://github.com/ellerbrock
# Twitter: https://twitter.com/frapsoft
# Docker: https://hub.docker.com/u/ellerbrock
# Quay: https://quay.io/user/ellerbrock
#
# Description:
# -----------
# Bash Shell v.5 with Bash-it, bats, bash-completion
FROM bash:5
MAINTAINER Maik Ellerbrock
ENV VERSION 0.1.0
# Optional Configuration Parameter
ARG SYSTEM_TZ
# Default Settings (for optional Parameter)
ENV SYSTEM_TZ ${SYSTEM_TZ:-Europe/Berlin}
ENV SERVICE_USER bashit
ENV SERVICE_HOME /home/${SERVICE_USER}
RUN \
adduser -h ${SERVICE_HOME} -s /bin/bash -u 1000 -D ${SERVICE_USER} && \
apk add --no-cache \
bash-completion \
dumb-init \
git \
tzdata && \
cp /usr/share/zoneinfo/${SYSTEM_TZ} /etc/localtime && \
echo "${SYSTEM_TZ}" > /etc/TZ && \
git clone --depth 1 https://github.com/Bash-it/bash-it.git /tmp/bash_it && \
cp -R /tmp/bash_it /root/.bash_it && \
cp -R /tmp/bash_it ${SERVICE_HOME}/.bash_it && \
/root/.bash_it/install.sh --silent && \
echo -e "\n# Load bash-completion\n[ -f /usr/share/bash-completion/bash_completion ] && source /usr/share/bash-completion/bash_completion" >> /root/.bashrc && \
git clone --depth 1 https://github.com/sstephenson/bats.git /tmp/bats && \
/tmp/bats/install.sh /usr/local && \
cp -R ${SERVICE_HOME}/.bash_it /root && \
chown -R ${SERVICE_USER}:${SERVICE_USER} ${SERVICE_HOME} && \
sed -i -e "s/bin\/ash/bin\/bash/" /etc/passwd && \
apk del git tzdata && \
rm -rf /tmp/{.}* /tmp/*
USER ${SERVICE_USER}
WORKDIR ${SERVICE_HOME}
RUN \
${SERVICE_HOME}/.bash_it/install.sh --silent && \
echo -e "\n# Load bash-completion\n[ -f /usr/share/bash-completion/bash_completion ] && source /usr/share/bash-completion/bash_completion" >> ${SERVICE_HOME}/.bashrc
ENTRYPOINT [ "/usr/bin/dumb-init", "bash" ]