From af5a4f7ceec67dbf2623d58269362748d9e46bfa Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 21 Sep 2018 09:58:01 -0500 Subject: [PATCH] constrain go, add user home dir --- docker/Dockerfile | 2 +- docker/executors/go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 96fef43..e216cac 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get -y install ruby RUN apt-get -y install nodejs RUN apt-get -y install golang -RUN useradd -g root runner +RUN useradd -m runner RUN echo '@runner soft nproc 16' >> /etc/security/limits.conf RUN echo '@runner hard nproc 16' >> /etc/security/limits.conf diff --git a/docker/executors/go b/docker/executors/go index 4387b07..7842675 100755 --- a/docker/executors/go +++ b/docker/executors/go @@ -1,3 +1,9 @@ #!/bin/sh -go run $1 +file=$1 + +go build $file + +file=${file%%.*} + +timeout -s HUP 2 ./$file