Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
gitlab-runner
Commits
383c5340
Commit
383c5340
authored
Apr 09, 2019
by
Michał "rysiek" Woźniak
Browse files
Support for GITLAB_RUNNER_{UID,GID} build args added
parent
c167f04a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
Dockerfile
Dockerfile
+8
-0
entrypoint
entrypoint
+30
-0
No files found.
Dockerfile
View file @
383c5340
...
...
@@ -8,6 +8,14 @@ MAINTAINER Michał "rysiek" Woźniak <rysiek@occrp.org>
# environment
ENV
DEBIAN_FRONTEND=noninteractive
# uid and gid of the gitlab-runner user
ARG
GITLAB_RUNNER_UID=999
ARG
GITLAB_RUNNER_GID=999
# and let's modify the group and the user
RUN
groupmod
--gid
${
GITLAB_RUNNER_GID
}
gitlab-runner
\
&&
usermod
--uid
"
${
GITLAB_RUNNER_UID
}
"
gitlab-runner
# adding repository keys
ARG
ADD_REPOSITORY_KEYS=
RUN if
[
"
$ADD_REPOSITORY_KEYS
"
!=
""
]
;
then
\
...
...
entrypoint
0 → 100644
View file @
383c5340
#!/bin/bash
#
# almost exact copy of:
# https://gitlab.com/gitlab-org/gitlab-runner/blob/master/dockerfiles/ubuntu/entrypoint
# (original is MIT-licensed)
#
# we need our copy because we want to run gitlab-runner as a specific user:group
#
# gitlab-runner data directory
DATA_DIR
=
"/etc/gitlab-runner"
CONFIG_FILE
=
${
CONFIG_FILE
:-
$DATA_DIR
/config.toml
}
# custom certificate authority path
CA_CERTIFICATES_PATH
=
${
CA_CERTIFICATES_PATH
:-
$DATA_DIR
/certs/ca.crt
}
LOCAL_CA_PATH
=
"/usr/local/share/ca-certificates/ca.crt"
update_ca
()
{
echo
"Updating CA certificates..."
cp
"
${
CA_CERTIFICATES_PATH
}
"
"
${
LOCAL_CA_PATH
}
"
update-ca-certificates
--fresh
>
/dev/null
}
if
[
-f
"
${
CA_CERTIFICATES_PATH
}
"
]
;
then
# update the ca if the custom ca is different than the current
cmp
--silent
"
${
CA_CERTIFICATES_PATH
}
"
"
${
LOCAL_CA_PATH
}
"
||
update_ca
fi
# launch gitlab-runner passing all arguments
exec
su
-p
-c
"env PATH=
\"
$PATH
\"
gitlab-runner
$*
"
gitlab-runner
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment