Public | Automated Build

Last pushed: 7 hours ago
Short Description
GitLab Community Edition docker image based on the Omnibus package
Full Description

GitLab Docker images

Docker Pull Command
Owner
gitlab
Source Repository

Comments (86)
researchiteng
15 days ago

Some below asked how to run this container. The best way we came to run gitlab in docker containers (to ensure maximum performance and parameters as per documentation) is below.
We use this in a production with hundreds of users:

#/bin/bash -vx

#Desired version, unless one provided as argument
VERSION=${1:-'8.17.3-ce.0'}
#VERSION='8.13.0-ce.0'
#VERSION='latest'

echo "Going to use: gitlab/gitlab-ce:${VERSION} "

docker pull gitlab/gitlab-ce:${VERSION}
docker stop gitlab
docker rm gitlab

#This is req. in case you use SELinux:
chcon -Rt svirt_sandbox_file_t /storage/srv/gitlab/ || true
#/proc/sys/fs/file-max #this is shared with the host
GITLAB_FILEMAX=1000000
[[ $(cat /proc/sys/fs/file-max) -lt ${GITLAB_FILEMAX} ]] && echo $GITLAB_FILEMAX > /proc/sys/fs/file-max

# https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1217 #mattermost docker containers
# # --sysctl vm.overcommit_memory=1 \
docker run --detach --name gitlab \
 --hostname gitlab.corp.dontbeevil.com \
 --sysctl net.core.somaxconn=1024 \
 --ulimit sigpending=62793 \
 --ulimit nproc=131072 \
 --ulimit nofile=60000 \
 --ulimit core=0 \
 --publish 443:443 --publish 80:80 --publish 22:22 --publish 8060:8060 \
 --restart always \
 --env GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.corp.dontbeevil.com/'; gitlab_rails['lfs_enabled'] = true; mattermost_external_url 'http://mattermost.corp.dontbeevil.com';" \
 --volume /storage/srv/gitlab/config:/etc/gitlab:z \
 --volume /storage/srv/gitlab/logs:/var/log/gitlab:z \
 --volume /storage/srv/gitlab/data:/var/opt/gitlab:z \
 --volume /etc/localtime:/etc/localtime \
 gitlab/gitlab-ce:${VERSION}

# --privileged is required in order to set proper ulimits somaxconn, fs.file-max, etc; from all these, only file-max influences host, rest are only at cont. level.
# --ulimit sigpending=62793 --ulimit nproc=131072
# we cannot mount /proc/sys/net/core/somaxconn inside container (docker error:  cannot be mounted because it is located inside "/proc" )
# none of of capabilites help. We tried: docker run --ulimit sigpending=62793 --ulimit nproc=131072 --cap-add=CHOWN --cap-add=DAC_OVERRIDE --cap-add=FSETID --cap-add=FOWNER --cap-add=MKNOD --cap-add=NET_RAW --cap-add=SETGID --cap-add=SETUID --cap-add=SETFCAP --cap-add=SETPCAP --cap-add=NET_BIND_SERVICE --cap-add=SYS_CHROOT --cap-add=KILL --cap-add=AUDIT_WRITE gitlab/gitlab-ce

# To remove --privileged we need docker 1.12+ where we can set sysctl parameters on docker run, like we can ulimit parameters now. Till then, we need --privileged.

echo -e "waiting for services to start before checking status. So: sleeping 60 sec. \nFor startup status, if you want, you may want to ctrl+x and run: 'docker logs -f gitlab' or 'docker exec gitlab gitlab-ctl status' yourself."
sleep 60
docker exec gitlab gitlab-ctl status
tureba
17 days ago

After fighting with this container for many months, I found out that there is sameersbn/gitlab which is much more polished, with saner defaults, no additional services bundled into a single container and the documentation is excelent.

So I strongly recommend it instead of this official (and extremely messy) gitlab/gitlab-ce one. The url is: https://hub.docker.com/r/sameersbn/gitlab/

If you don't already have a redis and a postgres installation ready, please, just use docker-compose instead of sticking many services into one container: http://www.damagehead.com/docker-gitlab/

davidshen84
17 days ago

Does the service starts on port 443? I have mapped the port, but access port 443 gives me nothing. Port 80 works well.

davidshen84
17 days ago

Please add description about how to use this image. E.g.:

What are these volumes for?

"/etc/gitlab", "/var/opt/gitlab", "/var/log/gitlab"
rour
25 days ago

Hi , i try to build this Dockerfile locally (docker build -t gitlab .) but it shows me this error all the time :

Step 12/13 : COPY /assets/wrapper /usr/local/bin/
lstat assets/wrapper: no such file or directory

someone can help PLZ

udixi
a month ago

Hi all.

I want to migrate from one VPS to another with this image, what is best way to move all info?

abhijitsarkar
2 months ago

Almost 6000 open issues on Gitlab CE. Reason enough why they're not GitHub.

alexhaller
3 months ago

Hi, can you pls provide an image for ARM-architecture (Raspberry Pi 3)? Maybe this article will help: https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/
Thanks a lot!

brucezu
4 months ago

I check some image version got from https://hub.docker.com/r/gitlab/gitlab-ce/tags/
and run into the same error with https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1350

I provide some information.
Will you please check it.
If you need more information please let me know
Thank you

tureba
4 months ago

Right... their build system is a mess. It's the reason why the "Build Details" tab shows bogus data and their Dockerfile is broken. Really messy project.

You might want to search for known bugs in their issue trackers or open a new one. I suggest starting with these: