Skip to content

Commit 43a50e2

Browse files
committed
updated gitlab-runner to newer version with ubuntu 16.04 base image
1 parent d79601d commit 43a50e2

File tree

3 files changed

+26
-27
lines changed

3 files changed

+26
-27
lines changed

Dockerfile

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
# Use slim version without ui related stuff
2-
FROM gitlab/gitlab-runner:ubuntu-v10.6.0
1+
FROM gitlab/gitlab-runner:ubuntu-v10.8.0
32

4-
# Install add-apt-repository - this is needed because gitlab-runner still uses 14.04 and we want to get the latest jdk8 version
5-
RUN apt-get update && apt-get install -y software-properties-common python-software-properties
6-
7-
# Install latest Jdk 8
8-
RUN add-apt-repository ppa:openjdk-r/ppa && \
9-
apt-get update && \
10-
apt-get install -y openjdk-8-jdk && \
11-
apt-get clean && \
12-
rm -rf /var/lib/apt/lists/* && \
13-
rm -rf /var/cache/oracle-jdk8-installer;
14-
15-
# Fix certificate issues, found as of
16-
# https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/983302
17-
RUN apt-get update && \
18-
apt-get install -y ca-certificates-java && \
19-
apt-get clean && \
20-
update-ca-certificates -f && \
21-
rm -rf /var/lib/apt/lists/* && \
22-
rm -rf /var/cache/oracle-jdk8-installer;
3+
# Install the latest jdk8 version
4+
RUN apt-get update
5+
RUN apt-get install -y openjdk-8-jdk
236

247
# Setup JAVA_HOME, this is useful for docker commandline
258
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
@@ -37,10 +20,10 @@ ENV PATH=${M3_HOME}/bin:${PATH}
3720
ADD --chown=gitlab-runner:gitlab-runner data/.bash_profile /home/gitlab-runner/.bash_profile
3821

3922
# Setup Docker Client
40-
RUN curl --create-dirs --location --fail --show-error --silent --output /tmp/docker.tgz --url https://download.docker.com/linux/static/stable/x86_64/docker-17.12.0-ce.tgz \
23+
RUN curl --create-dirs --location --fail --show-error --silent --output /tmp/docker.tgz --url https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz \
4124
&& tar -xz -C /tmp -f /tmp/docker.tgz \
4225
&& mv /tmp/docker/docker /usr/bin \
4326
&& rm -rf /tmp/docker /tmp/docker
4427

45-
RUN curl --create-dirs --location --fail --show-error --silent --output /usr/bin/docker-compose --url https://github.com/docker/compose/releases/download/1.18.0/docker-compose-Linux-x86_64 \
28+
RUN curl --create-dirs --location --fail --show-error --silent --output /usr/bin/docker-compose --url https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64 \
4629
&& chmod +x /usr/bin/docker-compose

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,29 @@ Uses Gitlab CI Runner from https://gitlab.com/gitlab-org/gitlab-runner/blob/mast
44
extend it with installed:
55
* Java 8
66
* Maven 3
7-
* Docker Client
7+
* Docker Client, Docker Compose
88

99
# :wrench: Setup
1010
## Build
11-
`docker build -t danielprinz.github.io/java-maven-gitlab-runner .`
11+
`docker build -t danielprinz.github.io/java-maven-gitlab-runner:v10.8.0 .`
12+
13+
## Register a new Gitlab Runner
14+
https://docs.gitlab.com/runner/install/docker.html
15+
```
16+
docker run --rm -t -i -v /srv/my-gitlab-runner/config:/etc/gitlab-runner --name my-gitlab-runner \
17+
danielprinz.github.io/java-maven-gitlab-runner:v10.8.0 register
18+
```
1219

1320
## Run
1421
```
1522
docker run -d --name my-gitlab-runner --restart always \
1623
-v /srv/my-gitlab-runner/config:/etc/gitlab-runner \
1724
-v /var/run/docker.sock:/var/run/docker.sock \
18-
danielprinz.github.io/java-maven-gitlab-runner:latest
25+
danielprinz.github.io/java-maven-gitlab-runner:v10.8.0
1926
```
2027

21-
Note: `/srv/my-gitlab-runner/config/config.toml` file contains all gitlab runner specific settings and will be created on registration.
28+
Note: `/srv/my-gitlab-runner/config/config.toml` file contains all gitlab runner specific settings and will be created on registration. An example for a shell executor can be found in `/example/config.toml`
29+
2230
### Reference
2331
https://docs.gitlab.com/runner/install/docker.html
2432

example/config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
concurrent = 1
2+
check_interval = 0
3+
4+
[[runners]]
5+
name = "my-gitlab-runner"
6+
url = "<ulr>"
7+
token = "<token>"
8+
executor = "shell"

0 commit comments

Comments
 (0)