|
1 | 1 | # gitlab-ci-runner |
2 | 2 |
|
3 | | -FROM ubuntu:12.04 |
| 3 | +FROM ubuntu:14.04 |
4 | 4 | MAINTAINER Sytse Sijbrandij "[email protected]" |
5 | 5 |
|
6 | 6 | # This script will start a runner in a docker container. |
|
20 | 20 | # If you ever want to freshly rebuild the runner please use: |
21 | 21 | # docker build -no-cache -t gitlabhq/gitlab-ci-runner github.com/gitlabhq/gitlab-ci-runner |
22 | 22 |
|
| 23 | +# Get rid of the debconf messages |
| 24 | +ENV DEBIAN_FRONTEND noninteractive |
| 25 | + |
23 | 26 | # Update your packages and install the ones that are needed to compile Ruby |
24 | 27 | 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 |
26 | 30 |
|
27 | 31 | # 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 |
33 | 35 |
|
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 |
41 | 37 |
|
42 | | -# Set the right locale for Postgres |
| 38 | +# Set an utf-8 locale |
43 | 39 | RUN echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale |
44 | 40 | RUN locale-gen en_US.UTF-8 |
45 | 41 | RUN update-locale LANG=en_US.UTF-8 |
46 | 42 |
|
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 | | - |
56 | 43 | # Prepare a known host file for non-interactive ssh connections |
57 | 44 | RUN mkdir -p /root/.ssh |
58 | 45 | RUN touch /root/.ssh/known_hosts |
59 | 46 |
|
60 | 47 | # 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 |
62 | 50 |
|
63 | | -# Install the gems for the runner |
64 | | -RUN cd /gitlab-ci-runner && gem install bundler && bundle install |
| 51 | +WORKDIR /gitlab-ci-runner.git |
65 | 52 |
|
66 | 53 | # 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