Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit ea2e72f

Browse files
committed
Merge pull request #103 from stefan-it/stefan/dockerfile-update
Dockerfile update
2 parents dd65abf + 80b4bdd commit ea2e72f

File tree

1 file changed

+39
-29
lines changed

1 file changed

+39
-29
lines changed

Dockerfile

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gitlab-ci-runner
22

3-
FROM ubuntu:12.04
3+
FROM ubuntu:14.04
44
MAINTAINER Sytse Sijbrandij "[email protected]"
55

66
# This script will start a runner in a docker container.
@@ -20,49 +20,59 @@ MAINTAINER Sytse Sijbrandij "[email protected]"
2020
# If you ever want to freshly rebuild the runner please use:
2121
# docker build -no-cache -t gitlabhq/gitlab-ci-runner github.com/gitlabhq/gitlab-ci-runner
2222

23+
# Get rid of the debconf messages
24+
ENV DEBIAN_FRONTEND noninteractive
25+
2326
# Update your packages and install the ones that are needed to compile Ruby
2427
RUN apt-get update -y
25-
RUN apt-get install -y wget curl gcc libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev make build-essential zlib1g-dev openssh-server git-core libyaml-dev postfix libpq-dev libicu-dev
28+
RUN apt-get upgrade -y
29+
RUN apt-get install -y curl libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libssl-dev patch build-essential zlib1g-dev openssh-server libyaml-dev libicu-dev
2630

2731
# Download Ruby and compile it
28-
RUN mkdir /tmp/ruby && cd /tmp/ruby && curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
29-
RUN cd /tmp/ruby/ruby-1.9.3-p392 && ./configure --disable-install-rdoc && make && make install
30-
31-
# Fix upstart under a virtual host https://github.com/dotcloud/docker/issues/1024
32-
RUN dpkg-divert --local --rename --add /sbin/initctl && rm -f /sbin/initctl && ln -s /bin/true /sbin/initctl
32+
RUN mkdir /tmp/ruby
33+
RUN cd /tmp/ruby && curl --silent ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p481.tar.gz | tar xz
34+
RUN cd /tmp/ruby/ruby-2.0.0-p481 && ./configure --disable-install-rdoc && make install
3335

34-
# Install packages commonly required to test Rails projects before the test run starts
35-
# If they are not here you have to add them to the test script in the project settings
36-
RUN apt-get install -y libqtwebkit-dev # test with capybara
37-
RUN apt-get install -y sqlite3 libsqlite3-dev # sqlite is the default datastore
38-
RUN apt-get install -y libmysqlclient-dev # native extensions for the mysql2 gem
39-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y mysql-server # install MySQL with blank root password
40-
RUN cd /root && wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
36+
RUN gem install bundler
4137

42-
# Set the right locale for Postgres
38+
# Set an utf-8 locale
4339
RUN echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale
4440
RUN locale-gen en_US.UTF-8
4541
RUN update-locale LANG=en_US.UTF-8
4642

47-
# Install PostgreSQL, after install this should work: psql --host=127.0.0.1 roottestdb
48-
RUN apt-get install -y postgresql
49-
RUN cat /dev/null > /etc/postgresql/9.1/main/pg_hba.conf
50-
RUN echo "# TYPE DATABASE USER ADDRESS METHOD" >> /etc/postgresql/9.1/main/pg_hba.conf
51-
RUN echo "local all all trust" >> /etc/postgresql/9.1/main/pg_hba.conf
52-
RUN echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/9.1/main/pg_hba.conf
53-
RUN echo "host all all ::1/128 trust" >> /etc/postgresql/9.1/main/pg_hba.conf
54-
RUN /etc/init.d/postgresql start && su postgres -c "psql -c \"create user root;\"" && su postgres -c "psql -c \"alter user root createdb;\"" && su postgres -c "psql -c \"create database roottestdb owner root;\""
55-
5643
# Prepare a known host file for non-interactive ssh connections
5744
RUN mkdir -p /root/.ssh
5845
RUN touch /root/.ssh/known_hosts
5946

6047
# Install the runner
61-
RUN git clone https://github.com/gitlabhq/gitlab-ci-runner.git /gitlab-ci-runner
48+
RUN curl --silent -L https://gitlab.com/gitlab-org/gitlab-ci-runner/repository/archive.tar.gz | tar xz
49+
RUN cd gitlab-ci-runner.git && bundle install --deployment
6250

63-
# Install the gems for the runner
64-
RUN cd /gitlab-ci-runner && gem install bundler && bundle install
51+
WORKDIR /gitlab-ci-runner.git
6552

6653
# When the image is started add the remote server key, set up the runner and run it
67-
WORKDIR /gitlab-ci-runner
68-
CMD ssh-keyscan -H $GITLAB_SERVER_FQDN >> /root/.ssh/known_hosts && mysqld & /root/redis-stable/src/redis-server & /etc/init.d/postgresql start & bundle exec ./bin/setup_and_run
54+
CMD ssh-keyscan -H $GITLAB_SERVER_FQDN >> /root/.ssh/known_hosts && bundle exec ./bin/setup_and_run
55+
56+
## Optional dependencies
57+
##
58+
## Install packages commonly required to test Rails projects before the test run starts
59+
## If they are not here you have to add them to the test script in the project settings
60+
#RUN apt-get install -y libqtwebkit-dev # test with capybara
61+
#RUN apt-get install -y sqlite3 libsqlite3-dev # sqlite is the default datastore
62+
#RUN apt-get install -y libmysqlclient-dev # native extensions for the mysql2 gem
63+
#RUN apt-get install -q -y mysql-server # install MySQL with blank root password
64+
#RUN cd /root && wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
65+
#
66+
## Install PostgreSQL, after install this should work: psql --host=127.0.0.1 roottestdb
67+
#RUN apt-get install -y postgresql
68+
#RUN cat /dev/null > /etc/postgresql/9.3/main/pg_hba.conf
69+
#RUN echo "# TYPE DATABASE USER ADDRESS METHOD" >> /etc/postgresql/9.3/main/pg_hba.conf
70+
#RUN echo "local all all trust" >> /etc/postgresql/9.3/main/pg_hba.conf
71+
#RUN echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/9.3/main/pg_hba.conf
72+
#RUN echo "host all all ::1/128 trust" >> /etc/postgresql/9.3/main/pg_hba.conf
73+
#RUN /etc/init.d/postgresql start && su postgres -c "psql -c \"create user root;\"" && su postgres -c "psql -c \"alter user root createdb;\"" && su postgres -c "psql -c \"create database roottestdb owner root;\""
74+
#
75+
## When the image is started add the remote server key, set up the runner and run it
76+
#WORKDIR /gitlab-ci-runner.git
77+
#
78+
#CMD ssh-keyscan -H $GITLAB_SERVER_FQDN >> /root/.ssh/known_hosts && mysqld & /root/redis-stable/src/redis-server & /etc/init.d/postgresql start & bundle exec ./bin/setup_and_run

0 commit comments

Comments
 (0)