14

I am trying to generate my work in progress hugo website locally. It works fine with gitlab CI.

I installed docker and the gitlab runner service.

Then using the guide here I figured that I am supposed to do gitlab-runner exec docker pages. But that results in:

[0;33mWARNING: Since GitLab Runner 10.0 this command is marked as DEPRECATED and will be removed in one of upcoming releases[0;m
[0KRunning with gitlab-runner 10.5.0 (80b03db9)
[0;m[0KUsing Docker executor with image rocker/tidyverse:latest ...
[0;m[0KPulling docker image rocker/tidyverse:latest ...
[0;m[0KUsing docker image sha256:f9a62417cb9b800a07695f86027801d8dfa34552c621738a80f5fed649c1bc80 for rocker/tidyverse:latest ...
[0;m[31;1mERROR: Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/jan/Desktop/gits/stanstrup-web:C:\Users\jan\Desktop\gits\stanstrup-web:ro'
[0;m[31;1mFATAL: Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/jan/Desktop/gits/stanstrup-web:C:\Users\jan\Desktop\gits\stanstrup-web:ro'[0;m

I also tried registering it as other guides show but I end up with the same issue.

Others have had some issues:

Am I supposed to set something in .gitlab-ci.yml? Should volumes be set there? In which case how/where?



The .gitlab-ci.yml says:

image: rocker/tidyverse:latest

before_script:
  - apt-get update && apt-get -y install default-jdk pandoc r-base r-cran-rjava curl netcdf-bin libnetcdf-dev libxml2-dev libssl-dev
  - R CMD javareconf
  - Rscript .gitlab-ci.R

pages:
  script:
    - R -e "blogdown::build_site()"
  artifacts:
    paths:
      - public
  only:
    - master
Matheus Santana
  • 581
  • 1
  • 6
  • 22
Jan Stanstrup
  • 1,152
  • 11
  • 28
  • Did you use a `docker-compose.yml`? If yes then please post that too in your question – Tarun Lalwani Mar 21 '18 at 04:13
  • If I understood correctly the equivalent is the .gitlab-ci.yml. I have added that to the Q. – Jan Stanstrup Mar 21 '18 at 08:57
  • Gitlab runner is executing the compose/container here and the runner is not taking care of the path. I don't have windows to recommend what could be the possible steps you could try and explore. But the issue cannot be resolved using `COMPOSE_CONVERT_WINDOWS_PATHS=1` because runner should have that variable. See if it can be passed inside the gitlab runner and make it work? – Tarun Lalwani Mar 23 '18 at 08:09
  • According to the link you provided (the *open* issue https://gitlab.com/gitlab-org/gitlab-runner/issues/1775), this is a known bug due to the "colon" separator of paths under Windows; it seems that a bugfix has been devised (https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/706) but it has not already been integrated and released... – ErikMD Mar 24 '18 at 16:07
  • I wonder why commands in `before_script` are not placed in a Dockerfile (to build your own image). – RLesur Mar 26 '18 at 19:59
  • Did you check that the env var was available? – Bob Lokerse Mar 27 '18 at 09:22
  • @Bob Lokerse In the calling shell yes. Not inside the docker. How? – Jan Stanstrup Mar 27 '18 at 16:07
  • @JanStanstrup I guess so. Where it is used. (Sorry, I do not know the exact details). When setting env. vars. they are not always directly available in the same shell, if I remember correctly. Always good to check. ;-) – Bob Lokerse Mar 29 '18 at 12:27
  • Still not fixed in version 10.7.0. – Jan Stanstrup Apr 27 '18 at 18:05

1 Answers1

2

Looks like you hit the colon seperator bug in docker for windows which lots of tools have to work around , gitlab has noticed it

until the fix comes out the simplest workaround would be for you to try doing this in a linux vm on your windows box. get prebuilt gitlab vm images from bitnami here.

otherwise you could checkout and run the gitlab-runner source branch with the fix, however it shows some conflicts and might have other bugs.

Amias
  • 335
  • 6
  • 16