From f484021148dfcc9e5dda8a0c202d6df0a12e51dc Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 15 Jan 2023 16:52:10 -0800 Subject: [PATCH] feat: add docker image, auto-built using CI --- .dockerignore | 4 ++++ .drone.yml | 20 +++++++++++++++++++- Dockerfile | 21 +++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..d55c5bc6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +.dockerignore +*.swp +*.swo diff --git a/.drone.yml b/.drone.yml index 4702ba95..81bc67e5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -57,7 +57,25 @@ steps: depends_on: - fetch when: - event: tag + + - name: publish image + image: plugins/docker + settings: + auto_tag: true + username: 3wordchant + password: + from_secret: git_coopcloud_tech_token_3wc + repo: git.coopcloud.tech/coop-cloud/abra + tags: latest + depends_on: + - run shellcheck + - run flake8 + - run unit tests + - test installation script + when: + event: + exclude: + - pull_request volumes: - name: deps diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..1f9dd378 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM golang:1.18-alpine AS build + +ENV GOPRIVATE coopcloud.tech + +RUN apk add --no-cache make git gcc musl-dev + +COPY . /app + +WORKDIR /app + +RUN CGO_ENABLED=0 make build +# RUN rm go.sum && go get -v -d -u ./... && \ +# make build + +RUN ls /app + +FROM scratch + +COPY --from=build /app/abra /abra + +ENTRYPOINT ["/abra"]