I'm working on setting GitLab CE in a Docker container using Docker Compose. My OS is Ubuntu Server 24.04.
As part of the installation, I defined the shell variable $GITLAB_HOME in my .bash_profile. However, when I run docker-compose, GITLAB_HOME is not defined. What do I need to fix that? Output below.
dthacker@gitlab-docker:~/compose-lab$ echo $GITLAB_HOME
/srv/gitlab
dthacker@gitlab-docker:~/compose-lab$ sudo docker compose up -d
WARN[0000] The "GITLAB_HOME" variable is not set. Defaulting to a blank string.
WARN[0000] The "GITLAB_HOME" variable is not set. Defaulting to a blank string.
WARN[0000] The "GITLAB_HOME" variable is not set. Defaulting to a blank string.
and my docker_compost.yml file
image: gitlab/gitlab-ce:17.4.3-ce.0
container_name: gitlab
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
# Add any other gitlab.rb configuration here, each on its own line
external_url 'https://gitlab.example.com'
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
shm_size: '256m'