当前位置: 首页 > 面试题库 >

运行Gitlab Docker

郎雪风
2023-03-14
问题内容

我正在按照以下说明进行操作:http :
//doc.gitlab.com/omnibus/docker

但是http:// localhost是说Webpage is not available

这是我正在运行的命令(Ubuntu 14.04 LTS):

    ole@MKI:~$ docker version
    Client:
     Version:      1.9.1
     API version:  1.21
     Go version:   go1.4.3
     Git commit:   a34a1d5
     Built:        Fri Nov 20 17:56:04 UTC 2015
     OS/Arch:      linux/amd64

    Server:
     Version:      1.9.1
     API version:  1.21
     Go version:   go1.4.3
     Git commit:   a34a1d5
     Built:        Fri Nov 20 17:56:04 UTC 2015
     OS/Arch:      linux/amd64

    ole@MKI:~$ sudo docker run --detach \
    >     --hostname gitlab.example.com \
    >     --publish 443:443 --publish 80:80 --publish 22:22 \
    >     --name gitlab \
    >     --restart always \
    >     --volume /srv/gitlab/config:/etc/gitlab \
    >     --volume /srv/gitlab/logs:/var/log/gitlab \
    >     --volume /srv/gitlab/data:/var/opt/gitlab \
    >     gitlab/gitlab-ce:latest
    613d4d2d612f977d3d25746a169d9209acb864e57c5184083dccd02b1e4a157c

    ole@MKI:~$ docker ps
    CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS                                                          NAMES
    613d4d2d612f        gitlab/gitlab-ce:latest   "/assets/wrapper"   4 seconds ago       Up 2 seconds        0.0.0.0:22->22/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   gitlab

如果我重新运行,docker ps我得到以下信息:

    CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS                              PORTS                                                          NAMES
    613d4d2d612f        gitlab/gitlab-ce:latest   "/assets/wrapper"   9 minutes ago       Restarting (1) About a minute ago   0.0.0.0:22->22/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   gitlab

它说Restarting about a minute ago...…这是否意味着内部有问题?

[编辑-添加日志]

  ole@MKI:~$ sudo mkdir -p /var/log/gitlab/reconfigure

  ole@MKI:~$ sudo docker run --detach \
  >     --hostname gitlab.example.com \
  >     --publish 443:443 --publish 80:80 --publish 22:22 \
  >     --name gitlab \
  >     --restart always \
  >     --volume /srv/gitlab/config:/etc/gitlab \
  >     --volume /srv/gitlab/logs:/var/log/gitlab \
  >     --volume /srv/gitlab/data:/var/opt/gitlab \
  >     gitlab/gitlab-ce:latest
  f4dee0a603bdc95594e8a77d51762f2d78d44ec077f2d57645e651ed628a4d6b

  ole@MKI:~$ docker logs
  docker: "logs" requires 1 argument.
  See 'docker logs --help'.

  Usage:    docker logs [OPTIONS] CONTAINER

  Fetch the logs of a container

  ole@MKI:~$ docker logs gitlab
  Thank you for using GitLab Docker Image!
  Current version: gitlab-ce=8.5.0-ce.1

  Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
  And restart this container to reload settings.
  To do it use docker exec:

    docker exec -it gitlab vim /etc/gitlab/gitlab.rb
    docker restart gitlab

  For a comprehensive list of configuration options please see the Omnibus GitLab readme
  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  If this container fails to start due to permission problems try to fix it by executing:

    docker exec -it gitlab update-permissions
    docker restart gitlab

  Preparing services...
  Starting services...
  Configuring GitLab...
  /opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
  /opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
  [2016-02-23T01:16:47+00:00] FATAL: Failed to open or create log file at /var/log/gitlab/reconfigure/1456190207.log: Errno::ENOENT (No such file or directory @ rb_sysopen - /var/log/gitlab/reconfigure/1456190207.log)
  [2016-02-23T01:16:47+00:00] FATAL: Aborting due to invalid 'log_location' configuration
  Thank you for using GitLab Docker Image!
  Current version: gitlab-ce=8.5.0-ce.1

  Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
  And restart this container to reload settings.
  To do it use docker exec:

    docker exec -it gitlab vim /etc/gitlab/gitlab.rb
    docker restart gitlab

  For a comprehensive list of configuration options please see the Omnibus GitLab readme
  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  If this container fails to start due to permission problems try to fix it by executing:

    docker exec -it gitlab update-permissions
    docker restart gitlab

  Preparing services...
  Starting services...
  Configuring GitLab...
  /opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
  /opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
  [2016-02-23T01:16:51+00:00] FATAL: Failed to open or create log file at /var/log/gitlab/reconfigure/1456190211.log: Errno::ENOENT (No such file or directory @ rb_sysopen - /var/log/gitlab/reconfigure/1456190211.log)
  [2016-02-23T01:16:51+00:00] FATAL: Aborting due to invalid 'log_location' configuration
  Thank you for using GitLab Docker Image!
  Current version: gitlab-ce=8.5.0-ce.1

  Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
  And restart this container to reload settings.
  To do it use docker exec:

    docker exec -it gitlab vim /etc/gitlab/gitlab.rb
    docker restart gitlab

  For a comprehensive list of configuration options please see the Omnibus GitLab readme
  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  If this container fails to start due to permission problems try to fix it by executing:

    docker exec -it gitlab update-permissions
    docker restart gitlab

  Preparing services...
  Starting services...
  Configuring GitLab...
  /opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
  /opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
  [2016-02-23T01:16:56+00:00] FATAL: Failed to open or create log file at /var/log/gitlab/reconfigure/1456190216.log: Errno::ENOENT (No such file or directory @ rb_sysopen - /var/log/gitlab/reconfigure/1456190216.log)
  [2016-02-23T01:16:56+00:00] FATAL: Aborting due to invalid 'log_location' configuration
  Thank you for using GitLab Docker Image!
  Current version: gitlab-ce=8.5.0-ce.1

  Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
  And restart this container to reload settings.
  To do it use docker exec:

    docker exec -it gitlab vim /etc/gitlab/gitlab.rb
    docker restart gitlab

  For a comprehensive list of configuration options please see the Omnibus GitLab readme
  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  If this container fails to start due to permission problems try to fix it by executing:

    docker exec -it gitlab update-permissions
    docker restart gitlab

  Preparing services...
  Starting services...
  Configuring GitLab...
  /opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
  /opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
  [2016-02-23T01:17:02+00:00] FATAL: Failed to open or create log file at /var/log/gitlab/reconfigure/1456190222.log: Errno::ENOENT (No such file or directory @ rb_sysopen - /var/log/gitlab/reconfigure/1456190222.log)
  [2016-02-23T01:17:02+00:00] FATAL: Aborting due to invalid 'log_location' configuration
  Thank you for using GitLab Docker Image!
  Current version: gitlab-ce=8.5.0-ce.1

  Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
  And restart this container to reload settings.
  To do it use docker exec:

    docker exec -it gitlab vim /etc/gitlab/gitlab.rb
    docker restart gitlab

  For a comprehensive list of configuration options please see the Omnibus GitLab readme
  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  If this container fails to start due to permission problems try to fix it by executing:

    docker exec -it gitlab update-permissions
    docker restart gitlab


  ole@MKI:~$ docker ps
  CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS                         PORTS                                                          NAMES
  f4dee0a603bd        gitlab/gitlab-ce:latest   "/assets/wrapper"   39 seconds ago      Restarting (1) 4 seconds ago   0.0.0.0:22->22/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   gitlab

即使/var/log/gitlab/reconfigure手动创建后,它仍然无法启动。


问题答案:

将docker命令修改为以下内容可为我解决此问题:

sudo docker run -i \
    --hostname ubuntu \
    --publish 443:443 --publish 80:80 --publish 2222:22 \
    --name gitlab \
    --restart always \
    --volume /srv/gitlab/config:/etc/gitlab \
    --volume /srv/gitlab/logs:/var/log/gitlab \
    --volume /srv/gitlab/data:/var/opt/gitlab \
    --volume /srv/gitlab/logs/reconfigure:/var/log/gitlab/reconfigure \
    gitlab/gitlab-ce:latest

请注意,我曾经使用过,-i所以我可以观看它的启动,但是您可以将其设置回--detach



 类似资料:
  • 我有超过50种不同类型的输入,我在功能文件中的Example关键字下定义了这些输入,执行这些输入需要花费更多的时间。有没有办法并行运行这些输入?。我不想让任何人来测试这种方法。请帮忙。

  • 我正在尝试运行多个类似这样的命令。 但这些都不起作用。 我已经搜索了Docker运行引用,但没有找到任何关于转义字符的提示。

  • 交互模式 在根目录中运行 sbt 命令不带任何参数将进入交互模式 $ sbt 交互模式有一个命令输入功能(可以用 Tab 补全和历史命令), 例如,当输入 compile 时: > compile 如果再次编译只需按 向上键 + 回车键 如果运行该项目输入 run 如果退出交互模式输入 exit 或用快捷键 Ctrl+D(Unix) 或 Ctrl+Z(Windows) 批量脚本模式 你也可以在批量

  • nodejs ASPnet5 unity office

  • Angel On Yarn运行 由于业界很多公司的大数据平台,都是基于Yarn搭建,所以Angel目前的分布式运行是基于Yarn,方便用户复用现网环境,而无需任何修改。 鉴于Yarn的搭建步骤和机器要求,不建议在小机器上,进行尝试该运行。如果一定要运行,最少需要6G的内存(1ps+1worker+1am),最好有10G的内存,比较宽裕。 1. 运行环境准备 Angel的分布式Yarn运行模式需要的

  • Python appdaemon -c /home/homeassistant/conf 其中 -c 之后为前述步骤所创建的 appdaemon 配置文件所在文件夹。 参数说明 使用方法: appdaemon [-h] [-c CONFIG] [-p PIDFILE] [-t TICK] [-s STARTTIME] [-e ENDTIME] [-i INTER

  • 问题内容: 我正在尝试使用NetBeans在Java Maven项目中实现Akka。当我从NetBeans运行它时,它运行良好,但是当我从NetBeans运行可运行的jar时,它会产生错误。 当我在配置中添加日志接收消息时,它要求其他配置。这是我用来生成jar文件的插件。 我的依赖是 akka的配置是 问题答案: 在http://doc.akka.io/docs/akka/snapshot/gen

  • 我在Eclipse中有一个maven项目。在src/main/resources下,我有一个名为“directoryToCopy”的目录,其中包含文件。一旦我运行了我的项目,我想将“directoryToCopy”复制到桌面上的本地目录“localDirec”下。 我用了这个: 这在本地工作正常,但是当我想将其作为可执行jar文件运行时,我会得到NullPointerException。 请问有什