To continue with this cheat sheet, right click the Docker icon in the system tray, and go to settings. In order to mount volumes, the C:/ drive will need to be enabled in the settings to that information can be passed into the containers (later described in this article). Docker Container Platform for Windows Server 2016 articles and blog posts on the Docker website. Where to go next. Getting started provides an overview of Docker for Windows, basic Docker command examples, how to get help or give feedback, and links to all topics in the Docker for Windows guide. FAQs provides answers to frequently asked questions.
- Docker Toolbox Windows 10 Family
- Docker Toolbox Windows 10 Tutorial
- Windows 10 Docker Toolbox Windows 10
The GitLab Docker images are monolithic images of GitLab running all thenecessary services in a single container. If you instead want to install GitLabon Kubernetes, see GitLab Helm Charts.
Find the GitLab official Docker image at:
The Docker images don’t include a mail transport agent (MTA). The recommendedsolution is to add an MTA (such as Postfix or Sendmail) running in a separatecontainer. As another option, you can install an MTA directly in the GitLabcontainer, but this adds maintenance overhead as you’ll likely need to reinstallthe MTA after every upgrade or restart.
In the following examples, if you want to use the latest RC image, use
Docker is required. See the official installation documentation.
Set up the volumes location
Before setting everything else, configure a new environment variable
$GITLAB_HOMEpointing to the directory where the configuration, logs, and data files will reside.Ensure that the directory exists and appropriate permission have been granted.
For Linux users, set the path to
For macOS users, use the user’s
|Local location||Container location||Usage|
|For storing application data.|
|For storing logs.|
|For storing the GitLab configuration files.|
The GitLab Docker images can be run in multiple ways:
Install GitLab using Docker Engine
You can fine tune these directories to meet your requirements.Once you’ve set up the
GITLAB_HOME variable, you can run the image:
This will download and start a GitLab container and publish ports needed toaccess SSH, HTTP and HTTPS. All GitLab data will be stored as subdirectories of
$GITLAB_HOME. The container will automatically
restart after a system reboot.
If you are on SELinux, then run this instead:
This will ensure that the Docker process has enough permissions to create theconfig files in the mounted volumes.
If you’re using the Kerberos integration,you must also publish your Kerberos port (for example,
--publish 8443:8443).Failing to do so prevents Git operations with Kerberos.
The initialization process may take a long time. You can track thisprocess with:
After starting a container you can visit
http://192.168.59.103 if you used boot2docker on macOS). It might take a whilebefore the Docker container starts to respond to queries.The very first time you visit GitLab, you will be asked to set up the adminpassword. After you change it, you can log in with username
root and thepassword you set up.
Install GitLab using Docker Compose
With Docker Compose you can easily configure,install, and upgrade your Docker-based GitLab installation:
- Install Docker Compose.
docker-compose.ymlfile (or download an example):
Make sure you are in the same directory as
Below is another
docker-compose.yml example with GitLab running on a customHTTP and SSH port. Notice how the
GITLAB_OMNIBUS_CONFIG variables match the
This is the same as using
--publish 8929:8929 --publish 2224:22.
Install GitLab using Docker swarm mode
With Docker swarm mode, you can easilyconfigure and deploy yourDocker-based GitLab installation in a swarm cluster.
In swarm mode you can leverage Docker secretsand Docker configs to efficiently and securely deploy your GitLab instance.Secrets can be used to securely pass your initial root password without exposing it as an environment variable.Configs can help you to keep your GitLab image as generic as possible.
Here’s an example that deploys GitLab with four runners as a stack, using secrets and configs:
- Set up a Docker swarm.
For simplicity reasons, the
networkconfiguration was omitted.More information can be found in the official Compose file reference.
Make sure you are in the same directory as
This container uses the official Omnibus GitLab package, so all configurationis done in the unique configuration file
To access the GitLab configuration file, you can start a shell session in thecontext of a running container. This will allow you to browse all directoriesand use your favorite text editor:
You can also just edit
Once you open
/etc/gitlab/gitlab.rb make sure to set the
external_url topoint to a valid URL.
To receive e-mails from GitLab you have to configure theSMTP settings because the GitLab Docker image doesn’thave an SMTP server installed. You may also be interested inenabling HTTPS.
After you make all the changes you want, you will need to restart the containerin order to reconfigure GitLab:
GitLab will reconfigure itself whenever the container starts.For more options about configuring GitLab, check theconfiguration documentation.
Pre-configure Docker container
You can pre-configure the GitLab Docker image by adding the environment variable
GITLAB_OMNIBUS_CONFIG to Docker run command. This variable can contain any
gitlab.rb setting and is evaluated before the loading of the container’s
gitlab.rb file. This behavior allows you to configure the external GitLab URL,and make database configuration or any other option from theOmnibus GitLab template.The settings contained in
GITLAB_OMNIBUS_CONFIG aren’t written to the
gitlab.rb configuration file, and are evaluated on load.
Here’s an example that sets the external URL and enables LFS while startingthe container:
Note that every time you execute a
docker run command, you need to providethe
GITLAB_OMNIBUS_CONFIG option. The content of
GITLAB_OMNIBUS_CONFIG isnot preserved between subsequent runs.
Use tagged versions of GitLab
Tagged versions of the GitLab Docker images are also provided.To see all available tags see:
To use a specific tagged version, replace
gitlab/gitlab-ee:latest withthe GitLab version you want to run, for example
Run GitLab on a public IP address
You can make Docker to use your IP address and forward all traffic to theGitLab container by modifying the
To expose GitLab on IP
You can then access your GitLab instance at
Expose GitLab on different ports
GitLab will occupy some portsinside the container.
If you want to use a different host port than
80 (HTTP) or
443 (HTTPS),you need to add a separate
--publish directive to the
docker run command.
For example, to expose the web interface on the host’s port
8929, and the SSH service onport
Use the following
docker runcommand:The format for publishing ports is
hostPort:containerPort. Read more inDocker’s documentation aboutexposing incoming ports.
Enter the running container:
/etc/gitlab/gitlab.rbwith your editor and set
The port specified in this URL must match the port published to the host by Docker.Additionally, if the NGINX listen port is not explicitly set in
nginx['listen_port'], it will be pulled from the
external_url.For more information see the NGINX documentation.
Finally, reconfigure GitLab:
Following the above example, you will be able to reach GitLab from yourweb browser under
<hostIP>:8929 and push using SSH under the port
docker-compose.yml example that uses different ports can be found in theDocker compose section.
In most cases, updating GitLab is as easy as downloading the newest Dockerimage tag.
Update GitLab using Docker Engine
To update GitLab that was installed using Docker Engine:
- Take a backup.
Stop the running container:
Remove the existing container:
Pull the new image. For example, the latest GitLab image:
Create the container once again with thepreviously specified options:
On the first run, GitLab will reconfigure and update itself.
Refer to the GitLab Upgrade recommendationswhen upgrading between major versions.
Update GitLab using Docker compose
To update GitLab that was installed using Docker Compose:
- Take a backup.
Download the newest release and update your GitLab instance:
If you have used tags instead, you’ll needto first edit
Back up GitLab
You can create a GitLab backup with:
Read more on how to back up and restore GitLab.
GITLAB_OMNIBUS_CONFIGenvironment variable(per the “Pre-configure Docker Container” steps),meaning no configuration is set directly in the
gitlab.rbfile, then there is no needto back up the
Installing GitLab Community Edition
To install the Community Edition, replace
ce in the commands on thispage.
Docker Toolbox Windows 10 Family
The following information will help if you encounter problems using Omnibus GitLab and Docker.
Diagnose potential problems
Read container logs:
Enter running container:
From within the container you can administer the GitLab container as you wouldnormally administer anOmnibus installation
500 Internal Error
When updating the Docker image you may encounter an issue where all pathsdisplay a
500 page. If this occurs, restart the container to try to rectify theissue:
When updating from older GitLab Docker images you might encounter permissionproblems. This happens when users in previous images were notpreserved correctly. There’s script that fixes permissions for all files.
To fix your container, execute
update-permissions and restart thecontainer afterwards:
Error executing action run on resource ruby_block[directory resource: /data/GitLab]
This error occurs when using Docker Toolbox with VirtualBox on Windows or Mac,and making use of Docker volumes. The
/c/Users volume is mounted as aVirtualBox Shared Folder, and does not support the all POSIX filesystem features.The directory ownership and permissions cannot be changed without remounting, andGitLab fails.
Our recommendation is to switch to using the native Docker install for yourplatform, instead of using Docker Toolbox.
If you cannot use the native Docker install (Windows 10 Home Edition, or Windows 7/8),then an alternative solution is to setup NFS mounts instead of VirtualBox shares forDocker Toolbox’s boot2docker.
Linux ACL issues
If you are using file ACLs on the Docker host, the
docker group requires full access to the volumes in order for GitLab to work:
If these are not correct, set them with:
The default group is
docker. If you changed the group, be sure to update yourcommands.
/dev/shm mount not having enough space in Docker container
GitLab comes with a Prometheus metrics endpoint at
/-/metrics to expose avariety of statistics on the health and performance of GitLab. The filesrequired for this gets written to a temporary file system (like
By default, Docker allocates 64Mb to the shared memory directory (mounted at
/dev/shm). This is insufficient to hold all the Prometheus metrics relatedfiles generated, and will generate error logs like the following:
Other than disabling the Prometheus Metrics from the Admin page, the recommendedsolution to fix this problem is to increase the size of shm to at least 256Mb.If using
docker run, this can be done by passing the flag
--shm-size 256m.If using a
docker-compose.yml file, the
shm_size key can be used for thispurpose.
Help & feedback
DocsEdit this pageto fix an error or add an improvement in a merge request.
Create an issueto suggest an improvement to this page.
Show and post commentsto review and give feedback about this page.
ProductCreate an issueif there's something you don't like about this feature.
Propose functionalityby submitting a feature request.
Join First Lookto help shape new features.
Feature availability and product trialsView pricingto see all GitLab tiers and features, or to upgrade.
Try GitLab for freewith access to all features for 30 days.
If you didn't find what you were looking for,search the docs.
If you want help with something specific and could use community support,post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLabsubscription).
Docker Enterprise Edition for Windows Server 2016 (Docker EE) enables nativeDocker containers on Windows Server 2016. The Docker EE installation packageincludes everything you need to run Docker on Windows Server 2016.This topic describes pre-install considerations, and how to download andinstall Docker EE.
Looking for Release Notes?Get release notes for allversions here or subscribe to thereleases feed on the Docker Blog.
Docker Universal Control Plane and Windows
With Docker EE, your Windows nodes can join swarms that are managedby Docker Universal Control Plane (UCP). When you have Docker EE installedon Windows Server 2016 and you have aUCP manager node provisioned, you can join your Windows worker nodes to a swarm.
Install Docker EE
Docker EE for Windows requires Windows Server 2016. SeeWhat to know before you install for afull list of prerequisites.
Open a PowerShell command prompt, and type the following commands.
Test your Docker EE installation by running the
(optional) Make sure you have all required updates
Some advanced Docker features (like Swarm) require that Windows is updated to include the fixes in KB4015217 (or a later cumulative patch).
6) Download and Install Updates.
Use a script to install Docker EE
Use the following steps when you want to install manually, script automatedinstalls, or install on air-gapped systems.
In a PowerShell command prompt, download the installer archive on a machinethat has a connection.
Copy the zip file to the machine where you want to install Docker. In aPowerShell command prompt, use the following commands to extract the archive,register, and start the Docker service.
Test your Docker EE installation by running the
Install a specific version
To install a specific Docker version, you can use the
MinimumVersion flags. For example:
Update Docker EE
To update Docker EE on Windows Server 2016:
What to know before you install
- What the Docker EE for Windows install includes: The installationprovides Docker Engine and theDocker CLI client.
About Docker EE containers and Windows Server 2016
Looking for information on using Docker EE containers?
Getting Started with Windows Containers (Lab)provides a tutorial on how to set up and run Windows containers on Windows 10or Windows Server 2016. It shows you how to use a MusicStore application withWindows containers.
Setup - Windows Server 2016 (Lab)describes environment setup in detail.
Docker Container Platform for Windows Server 2016 articles and blogposts on the Docker website.
Where to go next
Docker Toolbox Windows 10 Tutorial
Getting started provides an overview ofDocker for Windows, basic Docker command examples, how to get help or givefeedback, and links to all topics in the Docker for Windows guide.
FAQs provides answers to frequently askedquestions.
Release Notes lists componentupdates, new features, and improvements associated with Stable and Edgereleases.
Learn Docker provides general Docker tutorials.
Windows Containers on Windows Serveris the official Microsoft documentation.