forked from mathew-fleisch/bashbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (32 loc) · 1.22 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
FROM alpine:latest
LABEL maintainer="Mathew Fleisch <[email protected]>"
ENV BASHBOT_CONFIG_FILEPATH=/bashbot/config.json
ENV BASHBOT_ENV_VARS_FILEPATH ""
ENV SLACK_TOKEN ""
ENV LOG_LEVEL "info"
ENV LOG_FORMAT "text"
ENV ASDF_DATA_DIR /root/.asdf
RUN apk add --update bash curl git make go jq python3 py3-pip openssh vim \
&& rm /bin/sh && ln -s /bin/bash /bin/sh \
&& ln -s /usr/bin/python3 /usr/local/bin/python
# Install asdf dependencies
WORKDIR /root
COPY .tool-versions /root/.tool-versions
COPY pin /root/pin
RUN mkdir -p $ASDF_DATA_DIR \
&& git clone --depth 1 https://github.com/asdf-vm/asdf.git $ASDF_DATA_DIR --branch v0.8.1 \
&& . $ASDF_DATA_DIR/asdf.sh \
&& echo -e '\n. $ASDF_DATA_DIR/asdf.sh' >> $HOME/.bashrc \
&& echo -e '\n. $ASDF_DATA_DIR/asdf.sh' >> $HOME/.profile \
&& while IFS= read -r line; do asdf plugin add $(echo "$line" | awk '{print $1}'); done < .tool-versions \
&& asdf install
RUN mkdir -p /bashbot
WORKDIR /bashbot
COPY . .
RUN mkdir -p vendor
RUN . ${ASDF_DATA_DIR}/asdf.sh \
&& make build \
&& mv bin/bashbot-* /usr/local/bin/bashbot \
&& chmod +x /usr/local/bin/bashbot \
&& rm -rf /tmp/*
CMD /bin/sh -c ". ${ASDF_DATA_DIR}/asdf.sh && ./entrypoint.sh"