Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
🐳 finish from building all botway docker files, images, and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
david-tomson committed May 8, 2022
1 parent 5553646 commit f541955
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker/alpine.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM botwayorg/botway:core AS core
FROM alpine:latest

RUN apk update && apk add bash sudo

ENV BOTWAY_DIR /botway-dir/

RUN addgroup --gid 1000 botway \
&& adduser --uid 1000 --disabled-password botway --ingroup botway \
&& mkdir -p $BOTWAY_DIR \
&& chown botway:botway $BOTWAY_DIR

COPY --from=core /botway /bin/botway
COPY ./entry.sh /usr/local/bin/docker-entrypoint.sh

RUN chmod 755 /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["docker-entrypoint.sh"]
CMD [ "help" ]
18 changes: 18 additions & 0 deletions docker/centos.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM botwayorg/botway:core AS core
FROM centos:8

ENV BOTWAY_DIR /botway-dir/

RUN groupadd -g 1993 botway \
&& adduser -u 1993 -g botway botway \
&& mkdir $BOTWAY_DIR \
&& chown botway:botway $BOTWAY_DIR

COPY --from=core /botway /bin/botway

COPY ./entry.sh /usr/local/bin/docker-entrypoint.sh

RUN chmod 755 /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["help"]
19 changes: 19 additions & 0 deletions docker/core.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM buildpack-deps:20.04-curl AS download

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y unzip \
&& rm -rf /var/lib/apt/lists/*

RUN curl -s https://get-latest.herokuapp.com/abdfnx/botway >> tag.txt

RUN curl -fsSL "https://github.com/abdfnx/botway/releases/download/$(cat tag.txt)/botway_linux_$(cat tag.txt)_amd64.zip" \
--output botway.zip \
&& unzip botway.zip \
&& rm botway.zip \
&& mv "botway_linux_$(cat tag.txt)_amd64/bin/botway" . \
&& chmod 755 botway

FROM scratch

COPY --from=download /botway /botway
16 changes: 16 additions & 0 deletions docker/debian.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM botwayorg/botway:core AS core
FROM debian:stable-slim

ENV BOTWAY_DIR /botway-dir/

RUN useradd --uid 1993 --user-group botway \
&& mkdir $BOTWAY_DIR \
&& chown botway:botway $BOTWAY_DIR

COPY --from=core /botway /usr/bin/botway
COPY ./entry.sh /usr/local/bin/docker-entrypoint.sh

RUN chmod 755 /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["help"]
9 changes: 9 additions & 0 deletions docker/distroless.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM botwayorg/botway:core AS core
FROM gcr.io/distroless/cc

ENV BOTWAY_DIR /botway-dir/

COPY --from=core /botway /bin/botway

ENTRYPOINT ["/bin/botway"]
CMD [ "help" ]
14 changes: 14 additions & 0 deletions docker/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -e

if [ "$1" != "${1#-}" ]; then
# if the first argument is an option like `--help` or `-h`
exec botway "$@"
fi

case "$1" in
docker | help | init | new | remove | tokens | version )
exec botway "$@";;
esac

exec "$@"
16 changes: 16 additions & 0 deletions docker/ubuntu.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM botwayorg/botway:core AS core
FROM ubuntu:20.04

ENV BOTWAY_DIR /botway-dir/

RUN useradd --uid 1993 --user-group botway \
&& mkdir $BOTWAY_DIR \
&& chown botway:botway $BOTWAY_DIR

COPY --from=core /botway /usr/bin/botway
COPY ./entry.sh /usr/local/bin/docker-entrypoint.sh

RUN chmod 755 /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["help"]

0 comments on commit f541955

Please sign in to comment.