GitLab docker volume error on Windows

I am trying to run the official gitlab / gitlab-ce image : the latest from docker on my Windows 10.
First . I tried to run it as shown below and it worked.

docker run --detach \
--hostname gitlab.example.com \
--publication 443: 443 - publication 8080: 80 - publication
22:22 \ --name gitlab \
- always always \
--volume / srv / gitlab / config: / etc / gitlab \
--volume / srv / gitlab / logs: / var / log / gitlab \
--volume / srv / gitlab / data: / var / opt / gitlab \
  gitlab / gitlab-ce: last

But the problem was that the changes to the container were not saved. I found that the matter is in volumes. This application works only for Boot2Docker VM. Well, I successfully shared my C: / drive with the host (Window) in docker settings (desktop application) and tested it. The Windows folder is open, and I see the files in the test container.

Now I am trying to run a gitlab image as follows:

docker run --detach\
    --hostname gitlab.example.com\
    -- 443: 443 - 8080: 80 - 22:22\
    --name gitlab\
    -- \
    --volume C:\Users\Public\Gitlab\config:/etc/gitlab\
    --volume C:\Users\Public\Gitlab\logs:/var/log/gitlab\
    --volume C:\Users\Public\Gitlab\data​​strong > :/var/opt/gitlab\
   gitlab/gitlab-:

:

# Logfile created on 2017-06-21 16:33:44 +0000 by logger.rb/56438
[2017-06-21T16:33:45+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /opt/gitlab/embedded
  One version per cookbook

[2017-06-21T16:33:45+00:00] INFO: Forking chef instance to converge...
[2017-06-21T16:33:45+00:00] INFO: *** Chef 12.12.15 ***
[2017-06-21T16:33:45+00:00] INFO: Platform: x86_64-linux
[2017-06-21T16:33:45+00:00] INFO: Chef-client pid: 26
[2017-06-21T16:33:45+00:00] WARN: unable to detect ipaddress
[2017-06-21T16:33:46+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/9ca249ba6250
[2017-06-21T16:33:46+00:00] INFO: Setting the run_list to ["recipe[gitlab]"] from CLI options
[2017-06-21T16:33:46+00:00] INFO: Run List is [recipe[gitlab]]
[2017-06-21T16:33:46+00:00] INFO: Run List expands to [gitlab]
[2017-06-21T16:33:46+00:00] INFO: Starting Chef Run for 9ca249ba6250
[2017-06-21T16:33:46+00:00] INFO: Running start handlers
[2017-06-21T16:33:46+00:00] INFO: Start handlers complete.
[2017-06-21T16:33:46+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
[2017-06-21T16:33:47+00:00] INFO: Loading cookbooks [gitlab@0.0.1, runit@0.14.2, package@0.0.0]
[2017-06-21T16:33:47+00:00] INFO: directory[/etc/gitlab] mode changed to 775
[2017-06-21T16:33:47+00:00] WARN: Skipped selecting an init system because it looks like we are running in a container
[2017-06-21T16:33:48+00:00] INFO: template[/var/opt/gitlab/.gitconfig] owner changed to 998
[2017-06-21T16:33:48+00:00] INFO: template[/var/opt/gitlab/.gitconfig] group changed to 998
[2017-06-21T16:33:48+00:00] INFO: template[/var/opt/gitlab/.gitconfig] mode changed to 644
[2017-06-21T16:33:48+00:00] INFO: Running queued delayed notifications before re-raising exception
[2017-06-21T16:33:48+00:00] ERROR: Running exception handlers
[2017-06-21T16:33:48+00:00] ERROR: Exception handlers complete
[2017-06-21T16:33:48+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2017-06-21T16:33:48+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-06-21T16:33:48+00:00] ERROR: ruby_block[directory resource: /var/opt/gitlab/git-data] (gitlab::gitlab-shell line 26) had an error: Mixlib::ShellOut::ShellCommandFailed: Failed asserting that ownership of "/var/opt/gitlab/git-data" was git
---- Begin output of set -x && [ "$(stat --printf='%U' $(readlink -f /var/opt/gitlab/git-data))" = 'git' ] ----
STDOUT: 
STDERR: + readlink -f /var/opt/gitlab/git-data
+ stat --printf=%U /var/opt/gitlab/git-data
+ [ root = git ]
---- End output of set -x && [ "$(stat --printf='%U' $(readlink -f /var/opt/gitlab/git-data))" = 'git' ] ----
Ran set -x && [ "$(stat --printf='%U' $(readlink -f /var/opt/gitlab/git-data))" = 'git' ] returned 1
[2017-06-21T16:33:48+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

, , ?

+4
2

HyperV Unix. - , , , . , 'chown', , :

[ "$(stat --printf='%U' $(readlink -f /var/opt/gitlab/git-data))" = 'git' ]

, , "git", "root".

. / , , . , , "root" "git". , . .

- , Unix. , , Docker Windows. , , .

. , Docker Windows .

+2

, Gitlab Docker Windows 10; .

Powershell .

/, Gitlab. (, Docker Desktop, C .)

mkdir c:\GitlabConfig
mkdir c:\GitlabConfig\backups

docker volume create gitlab-logs
docker volume create gitlab-data 
docker run --detach '
    --name gitlab '
    --restart always '
    --hostname gitlab.local '
    --publish 4443:443 --publish 4480:80 --publish 8222:22 '
    --volume C:\GitlabConfig:/etc/gitlab '
    --volume gitlab-logs:/var/log/gitlab '
    --volume gitlab-data:/var/opt/gitlab '
    gitlab/gitlab-ce

, Gitlab ; "localhost: 4480/" , -.

Gitlab, .

c:\GitlabConfig\gitlab.rb. 2 , ( ):

gitlab_rails ['manage_backup_path'] = false

gitlab_rails ['backup_path'] = "/etc/gitlab/backups"

, "backups" - , , .

.

docker restart gitlab

Gitlab, Windows

docker exec -it gitlab gitlab-rake gitlab:backup:create

c:\GitlabConfig\backups\{prefix}_gitlab_backup.tar Windows .

,

gitlab gitlab-rake gitlab:backup:restore BACKUP={prefix}

{} - , "_gitlab_backup.tar" , . , gitlab.rb.

Gitlab Windows 10. "c:\GitlabConfig" .

, docker- . , , . , . , , Gitlab , . , , ,

+1

Source: https://habr.com/ru/post/1679838/


All Articles