From a8e2d70b6b62ceef1721543ad30c9c4aec5af0b3 Mon Sep 17 00:00:00 2001 From: restitux Date: Sun, 23 Oct 2022 17:39:52 -0600 Subject: [PATCH] Add docker build flow --- .dockerignore | 2 ++ .gitignore | 3 ++- Dockerfile | 14 ++++++++++++++ docker-compose.yml | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..bd18bf7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +*.toml +*.yml diff --git a/.gitignore b/.gitignore index 6bfb938..b4e74e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -runner.toml +*.toml +*.yml run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c841f3d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.19-bullseye as builder +MAINTAINER restitux + +COPY . /runner +WORKDIR /runner +RUN go build . + + +FROM debian:bullseye +COPY --from=builder /runner/runner /runner +RUN apt-get update && apt-get install -y\ + git \ + && rm -rf /var/lib/apt/lists/* +ENTRYPOINT ["/runner"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f24c9b1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +version: "3" + +volumes: + docker-certs: + +networks: + cursorius: + +services: + cursorius-runner: + build: + context: . + dockerfile: ./Dockerfile + environment: + - "DOCKER_HOST=tcp://dind:2376" + - "DOCKER_CERT_PATH=/certs/client" + networks: + - cursorius + volumes: + - "./runner-docker.toml:/root/.config/cursorius/runner.toml" + - "./job:/job" + - docker-certs:/certs/client:ro + + + dind: + image: docker:dind + privileged: true + networks: + - cursorius + environment: + - "DOCKER_TLS_CERTDIR=/certs" + volumes: + - "./job:/job" + - docker-certs:/certs/client