Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions pre-commit.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Developer:
# ---------
# Name: Maik Ellerbrock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldnt write this under Maik's name. as he did not write it, you can write it your name here, it does not bear any responsibility 😄

#
# 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 bats and deps for development
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I said, lets just use the minimal dockerfile that you wrote for the pre-commit- no need for complicated stuff


FROM bash:5

MAINTAINER Maik Ellerbrock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put my name here instead, as Maik is not really present now


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}

# Configure Go
ENV GOROOT /usr/lib/go
ENV GOPATH ${SERVICE_HOME}/go

RUN \
adduser -h ${SERVICE_HOME} -s /bin/bash -u 1000 -D ${SERVICE_USER} && \
apk add --no-cache \
dumb-init \
git \
go \
py3-pip \
python3 \
python3-dev \
shellcheck \
tzdata && \
cp /usr/share/zoneinfo/${SYSTEM_TZ} /etc/localtime && \
echo "${SYSTEM_TZ}" > /etc/TZ && \
pip3 install pre-commit && \
GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt && \
ln -s ${GOPATH}/bin/shfmt /usr/local/bin \
git clone --depth 1 https://github.com/sstephenson/bats.git /tmp/bats && \
/tmp/bats/install.sh /usr/local && \
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}

ENTRYPOINT [ "/usr/bin/dumb-init", "bash" ]