遇到错误:dockergitlab_gitlab_1退出,代码为1

时间:2018-12-05 09:08:24

标签: docker docker-compose dockerfile

我运行docker-compose up命令时遇到了这个问题。 基本上,我使用的是link和外部mysql / postgres数据库使用的gitlab。这就是我的docker-compose.yml的样子

version: '2'
services:
  redis:
    restart: always
    image: sameersbn/redis:latest
    command:
    - --loglevel warning
    volumes:
    - /srv/docker/gitlab/redis:/var/lib/redis:Z
  gitlab:
    restart: always
    image: sameersbn/gitlab:11.5.1
    depends_on:
    - redis    
    ports:
    - "10080:80"
    - "10022:22"
  volumes:
    - /srv/docker/gitlab/gitlab:/home/git/data:Z
    environment:
    - DEBUG=true
    - DB_ADAPTER=mysql2
    - DB_HOST=<ip address of mysql>
    - DB_PORT=3306
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlabhq_production
    - REDIS_HOST=redis
    - REDIS_PORT=6379
    - GITLAB_HOST=localhost
    - GITLAB_PORT=10080
    - GITLAB_SSH_PORT=10022
    - GITLAB_RELATIVE_URL_ROOT=
    - GITLAB_SECRETS_DB_KEY_BASE=<KEY>
    - GITLAB_SECRETS_SECRET_KEY_BASE=<KEY>
    - GITLAB_SECRETS_OTP_KEY_BASE=<KEY>

获取如下日志

log image

启用--env 'DEBUG=true后,它将继续运行一次又一次。不知道哪里做错了。有人可以帮我吗

+ export GITLAB_INSTALL_DIR GITLAB_SHELL_INSTALL_DIR GITLAB_DATA_DIR GITLAB_REPOS_DIR GITLAB_DOWNLOADS_DIR GITLAB_SHARED_DIR GITLAB_HOST GITLAB_PORT GITLAB_RELATIVE_URL_ROOT GITLAB_HTTPS GITLAB_SSH_HOST GITLAB_SSH_PORT GITLAB_SIGNUP_ENABLED GITLAB_PROJECTS_LIMIT GITLAB_USERNAME_CHANGE GITLAB_CREATE_GROUP
+ local IFS=:
+ sudo -HEu git envsubst '$GITLAB_INSTALL_DIR:$GITLAB_SHELL_INSTALL_DIR:$GITLAB_DATA_DIR:$GITLAB_REPOS_DIR:$GITLAB_DOWNLOADS_DIR:$GITLAB_SHARED_DIR:$GITLAB_HOST:$GITLAB_PORT:$GITLAB_RELATIVE_URL_ROOT:$GITLAB_HTTPS:$GITLAB_SSH_HOST:$GITLAB_SSH_PORT:$GITLAB_SIGNUP_ENABLED:$GITLAB_PROJECTS_LIMIT:$GITLAB_USERNAME_CHANGE:$GITLAB_CREATE_GROUP'
+ rm -f /tmp/tmp.fJRiqAUhiC
+ gitlab_configure_database
+ echo -n 'Configuring gitlab::database'
+ gitlab_finalize_database_parameters
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -z localhost ]]
+ DB_ADAPTER=mysql2
+ case ${DB_ADAPTER} in
+ DB_ENCODING=utf8
+ DB_COLLATION=utf8_general_ci
+ DB_PORT=3306
+ DB_USER=gitlab
+ DB_NAME=gitlabhq_production
+ gitlab_check_database_connection
+ case ${DB_ADAPTER} in
+ prog='mysqladmin -h localhost -P 3306 -u gitlab -p password status'
+ timeout=60
+ mysqladmin -h localhost -P 3306 -u gitlab -p password status
++ expr 60 - 1
+ timeout=59
+ [[ 59 -eq 0 ]]
+ echo -n .
+ sleep 1
+ mysqladmin -h localhost -P 3306 -u gitlab -p password status
++ expr 59 - 1
+ timeout=58
+ [[ 58 -eq 0 ]]
+ echo -n .
+ sleep 1

+ mysqladmin -h localhost -P 3306 -u gitlab -ppassword status
++ expr 1 - 1
+ timeout=0
Configuring 
gitlab::database...........................................................

` 然后容器退出了。

0 个答案:

没有答案