Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gitlab-runner
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
infra
docker
gitlab-runner
Commits
b870c5a4
Commit
b870c5a4
authored
Jul 17, 2019
by
Kevin Daudt
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docker file to build the image
parent
c4265cbb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
0 deletions
+81
-0
Dockerfile
Dockerfile
+16
-0
README.md
README.md
+34
-0
docker-compose.yml
docker-compose.yml
+8
-0
register-runner
register-runner
+13
-0
run
run
+10
-0
No files found.
Dockerfile
0 → 100644
View file @
b870c5a4
FROM
alpine:latest
ENV
SSL_CERT_FILE /etc/ssl/cert.pem
RUN
echo
'@edge/testing http://dl-cdn.alpinelinux.org/alpine/edge/testing'
>>
/etc/apk/repositories
\
&&
apk upgrade
-U
--no-cache
\
&&
apk add
-U
--no-cache
\
gitlab-runner@edge/testing
\
&&
adduser
-D
-S
-h
/home/gitlab-runner gitlab-runner
COPY
register-runner /usr/local/bin
VOLUME
["/etc/gitlab-runner", "/home/gitlab-runner"]
ENTRYPOINT
["/usr/bin/gitlab-runner"]
CMD
["run", "--user=gitlab-runner", "--working-directory=/home/gitlab-runner"]
README.md
View file @
b870c5a4
...
@@ -2,3 +2,37 @@
...
@@ -2,3 +2,37 @@
This will create a docker image for running a gitlab runner on Alpine Linux on
This will create a docker image for running a gitlab runner on Alpine Linux on
all the architectures that Alpine Linux supports.
all the architectures that Alpine Linux supports.
## Starting the runner
To run the container, 1 required and 2 optional volumes need to be attached:
*
docker socket (/var/run/docker.sock)
*
conf dir (/etc/alpine-runner)
*
home dir (/home/gitlab-runner)
For example:
```
sh
docker run
-d
\
-v
/srv/gitlab-runner/conf:/etc/gitlab-runner
\
-v
/srv/gitlab-runner/home:/home/gitlab-runner
\
-v
/var/run/docker.sock:/var/run/docker.sock
\
gitlab-runner
```
You can execute
`./run`
to run this command
## Register the runner
There is a
`./register-runner`
command available in the container to register it.
To execute it, use the following command:
```
sh
docker
exec
-e
ARCH
=
<
arch
>
-e
GITLAB_REGISTER_TOKEN
=
<token> <container> register-runner
```
*
`ARCH`
is added as a tag on the runner
*
`GITLAB_REGISTER_TOKEN`
is a token you can find under
`Settings > CI / CD > Runners`
of a specific project or under
`Admin > Overview > Runners`
.
docker-compose.yml
0 → 100644
View file @
b870c5a4
version
:
3
services
:
gitlab-runner
:
build
:
.
volumes
:
-
/srv/gitlab-runner/conf:/etc/gitlab-runner
-
/srv/gitlab-runner/home:/home/gitlab-runner
-
/var/run/docker.sock:/var/run/docker.sock
register-runner
0 → 100755
View file @
b870c5a4
#!/bin/sh
gitlab-runner register
\
--non-interactive
\
--url
"https://gitlab.alpinelinux.org/"
\
--registration-token
"
$GITLAB_REGISTER_TOKEN
"
\
--executor
"docker"
\
--docker-image
alpine:latest
\
--description
"docker-runner (
$ARCH
)"
\
--tag-list
"docker-alpine,
$ARCH
"
\
--run-untagged
=
"true"
\
--locked
=
"false"
\
--access-level
=
"not_protected"
run
0 → 100755
View file @
b870c5a4
#!/bin/sh
name
=
${
1
-gitlab-runner
}
docker run
-d
\
-v
/srv/gitlab-runner/conf:/etc/gitlab-runner
\
-v
/srv/gitlab-runner/home:/home/gitlab-runner
\
-v
/var/run/docker.sock:/var/run/docker.sock
\
--name
$name
\
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