diff --git a/Dockerfile b/Dockerfile index 01d369e88..920c96814 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E1DD270288B4E60 && rm -rf /var/lib/apt/lists/* COPY assets/build/ ${GITLAB_BUILD_DIR}/ +ARG GITLAB_EDITION=ce RUN bash ${GITLAB_BUILD_DIR}/install.sh COPY assets/runtime/ ${GITLAB_RUNTIME_DIR}/ diff --git a/README.md b/README.md index 939a441ba..d87f0d352 100644 --- a/README.md +++ b/README.md @@ -135,12 +135,20 @@ You can also pull the `latest` tag which is built from the repository *HEAD* docker pull sameersbn/gitlab:latest ``` -Alternatively you can build the image locally. +Alternatively you can build the images locally. + +## Community Edition ```bash docker build -t sameersbn/gitlab github.com/sameersbn/docker-gitlab ``` +## Enterprise Edition + +```bash +docker build --build-arg GITLAB_EDITION=ee -t sameersbn/gitlab-ee github.com/sameersbn/docker-gitlab +``` + # Quick Start The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). diff --git a/assets/build/install.sh b/assets/build/install.sh index 5c40ab36c..2d9a1a3dd 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -1,7 +1,14 @@ #!/bin/bash set -e -GITLAB_CLONE_URL=https://gitlab.com/gitlab-org/gitlab-ce.git +GITLAB_EDITION=${GITLAB_EDITION:-ce} + +# if we're using the enterprise edition suffix the version with -ee +if [ x"${GITLAB_EDITION}" = x"ee" ] ; then + GITLAB_VERSION="${GITLAB_VERSION}-ee" +fi + +GITLAB_CLONE_URL=https://gitlab.com/gitlab-org/gitlab-${GITLAB_EDITION}.git GITLAB_SHELL_URL=https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz GITLAB_WORKHORSE_URL=https://gitlab.com/gitlab-org/gitlab-workhorse.git GITLAB_PAGES_URL=https://gitlab.com/gitlab-org/gitlab-pages.git @@ -63,7 +70,7 @@ exec_as_git git config --global gc.auto 0 exec_as_git git config --global repack.writeBitmaps true # shallow clone gitlab-ce -echo "Cloning gitlab-ce v.${GITLAB_VERSION}..." +echo "Cloning gitlab-${GITLAB_EDITION} v.${GITLAB_VERSION}..." exec_as_git git clone -q -b v${GITLAB_VERSION} --depth 1 ${GITLAB_CLONE_URL} ${GITLAB_INSTALL_DIR} GITLAB_SHELL_VERSION=${GITLAB_SHELL_VERSION:-$(cat ${GITLAB_INSTALL_DIR}/GITLAB_SHELL_VERSION)}