Last active
September 11, 2018 14:39
-
-
Save lattmann/867ce63e5c87918afcee to your computer and use it in GitHub Desktop.
A docker file for gitlab ci runner with nvm and mongo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker-gitlab-ci-runner-nvm | |
# Usage: | |
# docker build -t gitlab-ci-runner-nvm . | |
# sudo mkdir -p /opt/gitlab-ci-runner-nvm-01 | |
# docker run --name gitlab-ci-runner-nvm-01 -it --rm -v /opt/gitlab-ci-runner-nvm-01:/home/gitlab_ci_runner/data gitlab-ci-runner-nvm app:setup | |
# Run it interactively | |
# docker run --name gitlab-ci-runner-nvm-01 -it --rm -v /opt/gitlab-ci-runner-nvm-01:/home/gitlab_ci_runner/data gitlab-ci-runner-nvm | |
# Run it in the background | |
# docker run --name gitlab-ci-runner-nvm-01 -it -d -v /opt/gitlab-ci-runner-nvm-01:/home/gitlab_ci_runner/data gitlab-ci-runner-nvm | |
# GitLab CI sample job https://gist.github.com/lattmann/351004710860c9b1ba32 | |
FROM sameersbn/gitlab-ci-runner:5.2.1 | |
MAINTAINER Zsolt Lattmann <[email protected]> | |
# Replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B9316A7BC7917B12 #44A334DA # 87374F5D | |
# Install base dependencies | |
RUN apt-get -qq update && apt-get install -y -q --no-install-recommends \ | |
apt-transport-https \ | |
build-essential \ | |
ca-certificates \ | |
curl \ | |
git \ | |
libssl-dev \ | |
python \ | |
rsync \ | |
software-properties-common \ | |
wget \ | |
mongodb-server \ | |
moreutils \ | |
unzip \ | |
&& rm -rf /var/lib/apt/lists/* | |
ENV NVM_DIR /usr/local/nvm | |
# nvm | |
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash \ | |
&& source $NVM_DIR/nvm.sh \ | |
&& nvm install 0.10.38 \ | |
&& nvm install 0.11.16 \ | |
&& nvm install 0.12.2 \ | |
&& nvm alias default 0.10.38 | |
RUN echo smallfiles = true >> /etc/mongodb.conf | |
RUN echo '#!/bin/bash -ex' >> /root/run.sh \ | |
&& echo '/etc/init.d/mongodb start' >> /root/run.sh \ | |
&& echo '/app/init app:start' >> /root/run.sh | |
CMD ["bash", "-xe", "/root/run.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment