Compare commits

..

2 Commits

Author SHA1 Message Date
restitux a8e2d70b6b Add docker build flow 2022-10-23 17:39:52 -06:00
restitux dbb7134626 Fix missing type field in container job mount 2022-10-23 17:36:24 -06:00
5 changed files with 53 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
*.toml
*.yml
+2 -1
View File
@@ -1,2 +1,3 @@
runner.toml
*.toml
*.yml
run
+14
View File
@@ -0,0 +1,14 @@
FROM golang:1.19-bullseye as builder
MAINTAINER restitux <restitux@ohea.xyz>
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"]
+34
View File
@@ -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
+1
View File
@@ -65,6 +65,7 @@ func RunJob(job Job, workingDir string) error {
// TODO: fix running the runner in docker (add VolumesFrom to HostConfig)
&container.HostConfig{
Mounts: []mount.Mount{{
Type: mount.TypeVolume,
Source: jobFolder,
Target: "/job",
ReadOnly: false,